Skip to content

Commit

Permalink
Handle printing style
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDeFreitas committed Oct 13, 2022
1 parent 62bd711 commit 0a22cf6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void Main(string[] args)
Console.ResetColor();

Console.WriteLine(
"To know how to format the file, read the description in the \"README.txt\" file."
"To know how to format the file, read the description in the \"README.txt\" file.\n"
+ "Source code: https://github.com/JoseDeFreitas/BulkCreateGoogleDrive."
);

Expand All @@ -48,6 +48,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The answer should be \"y\" or \"n\".");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}
}
Expand All @@ -63,6 +64,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The notepad application could not be found.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand All @@ -80,13 +82,15 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The file \"files.txt\" was not found.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}
catch (IOException)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("An IO error ocurred when opening the file.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand Down Expand Up @@ -117,6 +121,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"The \"credentials.json\" file was not found.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand All @@ -135,6 +140,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The answer should be \"y\" or \"n\".");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}
}
Expand Down Expand Up @@ -178,6 +184,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The format of the \"files.txt\" file is wrong.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand All @@ -194,6 +201,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The format of the \"files.txt\" file is wrong.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand Down Expand Up @@ -226,6 +234,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("The folder or the files couldn't be created.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(1);
}

Expand All @@ -235,6 +244,8 @@ static void Main(string[] args)
+ $"{skippedFilesCount} files were skipped because they already existed."
);
Console.ResetColor();
Console.Write("Type any character to exit.");
Console.ReadLine();
}
}
}

0 comments on commit 0a22cf6

Please sign in to comment.