Skip to content

Commit 08b9af8

Browse files
committed
resolved the exception thrown at a string specifying the default distro name
1 parent 700d546 commit 08b9af8

File tree

9 files changed

+18
-5
lines changed

9 files changed

+18
-5
lines changed

.vs/easyWSL/v16/.suo

-512 Bytes
Binary file not shown.

.vs/slnx.sqlite

0 Bytes
Binary file not shown.

easyWSL/DistroInstaller.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void GetRequestWithHeaderToFile(string url, string token, string type, string fi
145145
GetRequestWithHeaderToFile($"https://{registry}/v2/{repository}/blobs/{layer}", autorizationResponse.token, "application/vnd.docker.distribution.manifest.v2+json", layerPath);
146146
concatTarCommand += $" @{layerPath} ";
147147
}
148-
148+
149149

150150
Console.WriteLine("Creating install.tar file ...");
151151
if (layersList.Count == 1)

easyWSL/Program.cs

+17-4
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ static void Main(string[] args)
8383
Console.Write("A number of a distro you want to install: ");
8484

8585
isConversionSuccessful = Int32.TryParse(Console.ReadLine(), out distroNumber);
86-
} while ((distroNumber > count) ^ (isConversionSuccessful == false));
86+
} while ((distroNumber > sources.sources.Count + 1) ^ (isConversionSuccessful == false));
8787

88-
if(distroNumber == count)
88+
if(distroNumber == sources.sources.Count+1)
8989
{
9090
Console.Write("Specify a docker container: ");
9191
distroImage = Console.ReadLine();
@@ -97,16 +97,29 @@ static void Main(string[] args)
9797

9898

9999
Console.WriteLine(distroImage);
100+
100101
}
101102

102103
if(distroName == "")
103104
{
104-
Console.Write("A name for your distro (default " + sources.sources[distroNumber-1].name + "): ");
105+
if (distroNumber == sources.sources.Count + 1)
106+
Console.Write("A name for your distro: ");
107+
else
108+
Console.Write("A name for your distro (default " + sources.sources[distroNumber - 1].name + "): ");
105109
distroName = Console.ReadLine();
106110

107111
if (distroName == "")
108112
{
109-
distroName = sources.sources[distroNumber-1].name;
113+
if (distroNumber == sources.sources.Count + 1)
114+
{
115+
while(distroName == "")
116+
{
117+
Console.Write("A name for your distro: ");
118+
distroName = Console.ReadLine();
119+
}
120+
}
121+
else
122+
distroName = sources.sources[distroNumber-1].name;
110123
}
111124

112125
distroName = Regex.Replace(distroName, @"\s+", "");

easyWSL/bin/x64/Debug/easyWSL.exe

2 KB
Binary file not shown.

easyWSL/bin/x64/Debug/easyWSL.pdb

0 Bytes
Binary file not shown.
Binary file not shown.

easyWSL/obj/x64/Debug/easyWSL.exe

2 KB
Binary file not shown.

easyWSL/obj/x64/Debug/easyWSL.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)