mirror of
https://github.com/tonytins/staggerpost.git
synced 2025-05-09 18:01:41 -04:00
Compare commits
No commits in common. "9d7f6b9f66a578d9250fade2c69e2933f95371e2" and "90c8c40b73f4a013f307062707fb2307c1de1636" have entirely different histories.
9d7f6b9f66
...
90c8c40b73
3 changed files with 6 additions and 13 deletions
|
@ -10,15 +10,11 @@ internal static class Interactive
|
|||
/// <returns>True if the user selects 'Y' or presses Enter, otherwise false.</returns>
|
||||
public static bool UserChoice(string choice)
|
||||
{
|
||||
Console.Write($"{Environment.NewLine}{choice} Y/N: ");
|
||||
Console.WriteLine($"{Environment.NewLine}{choice} Y/N");
|
||||
var input = Console.ReadKey().Key;
|
||||
if (input == ConsoleKey.Y || input == ConsoleKey.Enter)
|
||||
return true;
|
||||
|
||||
// Redundant measure
|
||||
if (input == ConsoleKey.Escape)
|
||||
Environment.Exit(Environment.ExitCode);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -44,11 +40,8 @@ internal static class Interactive
|
|||
userChoices.Add($"{Environment.NewLine}{numOfTopics} {title}");
|
||||
}
|
||||
|
||||
Console.WriteLine("=== Choose a Community ===");
|
||||
foreach (var choices in userChoices)
|
||||
Console.Write(choices);
|
||||
|
||||
Console.Write($"{Environment.NewLine}{Environment.NewLine}Type a number: ");
|
||||
var topicSelect = string.Join(", ", userChoices.ToArray());
|
||||
Console.WriteLine($"Choose a Topic{Environment.NewLine}{topicSelect}");
|
||||
var input = Console.ReadLine();
|
||||
|
||||
// Attempt to parse a number.
|
||||
|
|
|
@ -67,7 +67,7 @@ internal static class Tracer
|
|||
/// <summary>
|
||||
/// Determines the appropriate output directory based on the given directory path.
|
||||
/// In DEBUG mode, it always returns the current working directory.
|
||||
/// In release mode, it returns the provided directory unless it contains a "/.", in which case it defaults to the current directory.
|
||||
/// In release mode, it returns the provided directory unless it contains a '/', in which case it defaults to the current directory.
|
||||
/// </summary>
|
||||
/// <param name="dir">The directory path to evaluate.</param>
|
||||
/// <returns>The resolved output directory as a string.</returns>
|
||||
|
@ -78,7 +78,7 @@ internal static class Tracer
|
|||
#if DEBUG
|
||||
return curDir;
|
||||
#else
|
||||
if (dir.Contains("/."))
|
||||
if (dir.Contains("/"))
|
||||
return curDir;
|
||||
|
||||
return dir;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
path = "/."
|
||||
path = "/"
|
||||
file = "example.json"
|
||||
communities = [
|
||||
"Games",
|
||||
|
|
Loading…
Add table
Reference in a new issue