made a prompt to create a new manifest.json if not using the default folder
This commit is contained in:
parent
49bee022e9
commit
007588de38
2 changed files with 16 additions and 3 deletions
17
Manifest.cs
17
Manifest.cs
|
@ -63,8 +63,21 @@ public class Manifest
|
|||
if (!File.Exists(maFile))
|
||||
{
|
||||
if (Program.Verbose) Console.WriteLine("warn: No manifest file found at {0}", maFile);
|
||||
_manifest = _generateNewManifest(true);
|
||||
return _manifest;
|
||||
bool? createNewManifest = Program.SteamGuardPath ==
|
||||
Program.defaultSteamGuardPath.Replace("~", Environment.GetEnvironmentVariable("HOME")) ? true : (bool?) null;
|
||||
while (createNewManifest == null)
|
||||
{
|
||||
Console.Write($"Generate new manifest.json in {Program.SteamGuardPath}? [Y/n]");
|
||||
var answer = Console.ReadLine();
|
||||
if (answer != null)
|
||||
createNewManifest = !answer.StartsWith("n") && !answer.StartsWith("N");
|
||||
}
|
||||
if ((bool) createNewManifest)
|
||||
{
|
||||
_manifest = _generateNewManifest(true);
|
||||
return _manifest;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
|
|
|
@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
|||
|
||||
public static class Program
|
||||
{
|
||||
const string defaultSteamGuardPath = "~/maFiles";
|
||||
public const string defaultSteamGuardPath = "~/maFiles";
|
||||
|
||||
public static string SteamGuardPath { get; set; } = defaultSteamGuardPath;
|
||||
public static Manifest Manifest { get; set; }
|
||||
|
|
Loading…
Reference in a new issue