Skip to content

Commit

Permalink
Fix DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielweyer committed Oct 25, 2024
1 parent 53056d8 commit 81efec2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions coster/src/AzureVmCoster/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ private static (string? inputFilePath, string? configurationFilePath, CultureInf
#if DEBUG
Console.Write("Input file path: ");
inputFilePath = Console.ReadLine();
ArgumentReader.StripSurroundingDoubleQuotes(ref inputFilePath);

Console.Write("Configuration file path (leave blank if not used): ");
configurationFilePath = Console.ReadLine();
ArgumentReader.StripSurroundingDoubleQuotes(ref configurationFilePath);

Console.Write("Culture (leave blank for system default): ");
var cultureInput = Console.ReadLine();
Expand Down
4 changes: 2 additions & 2 deletions coster/src/AzureVmCoster/Services/ArgumentReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public static (string? inputFilePath, string? configurationFilePath, CultureInfo
/// usable if a space is present.</para>
/// </summary>
/// <param name="filePath">The reference will be assigned to only if the path starts with ".</param>
private static void StripSurroundingDoubleQuotes(ref string filePath)
public static void StripSurroundingDoubleQuotes(ref string? filePath)
{
if (filePath.StartsWith('"'))
if (filePath != null && filePath.StartsWith('"'))
{
filePath = filePath.Replace("\"", "", StringComparison.Ordinal);
}
Expand Down

0 comments on commit 81efec2

Please sign in to comment.