Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdeguet committed Oct 17, 2024
2 parents 9d3716c + 6e978b0 commit 44fa7df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions scriptsharp/ScriptSharp/Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ public static void AddToPath(string binPath)
string currentPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.User);
if (currentPath == null)
{
SetEnvironmentVariable("PATH", binPath);
SetEnvVariable("PATH", binPath);
}
else if (!currentPath.Contains(binPath))
{
LogSingleton.Get.LogAndWriteLine("Ajout au Path de " + binPath);
string updatedPath = currentPath + ";" + binPath;
SetEnvironmentVariable("PATH", updatedPath);
SetEnvVariable("PATH", updatedPath);
}
}

Expand All @@ -317,7 +317,7 @@ private static void RemoveFromPath(string pattern)
string[] filteredCurrentPathArray = currentPathArray.Where(path => !path.Contains(pattern)).ToArray();
string updatedPath = string.Join(";", filteredCurrentPathArray);

SetEnvironmentVariable("PATH", updatedPath);
SetEnvVariable("PATH", updatedPath);
}

public static void StartKmb()
Expand Down Expand Up @@ -409,12 +409,7 @@ private static void DeleteThis(string path)
}
}
}
public static void SetEnvironmentVariable(string variable, string value)
{
LogSingleton.Get.LogAndWriteLine("SetEnvironmentVariable démarré");
Environment.SetEnvironmentVariable(variable, value, EnvironmentVariableTarget.User);
LogSingleton.Get.LogAndWriteLine("SetEnvironmentVariable arrêté");
}

public static async Task DownloadRepo(string url, string name)
{
// download URL_3N5 to the Desktop and unzip it
Expand Down
4 changes: 2 additions & 2 deletions scriptsharp/ScriptSharp/Utils/UtilsAndroidSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public static async Task InstallAndroidSdk()
string sdkParentPath = Directory.GetParent(sdkPath)?.FullName;
await Utils.Unzip7ZFileAsync(Path.Combine(Config.LocalTemp, "Sdk.7z"), sdkParentPath);
// Add environment variables
Utils.SetEnvironmentVariable("ANDROID_SDK_ROOT", androidSdkRoot);
Utils.SetEnvironmentVariable("ANDROID_HOME", androidSdkRoot);
Utils.SetEnvVariable("ANDROID_SDK_ROOT", androidSdkRoot);
Utils.SetEnvVariable("ANDROID_HOME", androidSdkRoot);

// Append to PATH

Expand Down

0 comments on commit 44fa7df

Please sign in to comment.