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
13
Manifest.cs
13
Manifest.cs
|
@ -63,9 +63,22 @@ public class Manifest
|
||||||
if (!File.Exists(maFile))
|
if (!File.Exists(maFile))
|
||||||
{
|
{
|
||||||
if (Program.Verbose) Console.WriteLine("warn: No manifest file found at {0}", maFile);
|
if (Program.Verbose) Console.WriteLine("warn: No manifest file found at {0}", maFile);
|
||||||
|
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);
|
_manifest = _generateNewManifest(true);
|
||||||
return _manifest;
|
return _manifest;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
public static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
const string defaultSteamGuardPath = "~/maFiles";
|
public const string defaultSteamGuardPath = "~/maFiles";
|
||||||
|
|
||||||
public static string SteamGuardPath { get; set; } = defaultSteamGuardPath;
|
public static string SteamGuardPath { get; set; } = defaultSteamGuardPath;
|
||||||
public static Manifest Manifest { get; set; }
|
public static Manifest Manifest { get; set; }
|
||||||
|
|
Loading…
Reference in a new issue