Skip to content

Commit

Permalink
Fixed shit
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreOlivierBrillant committed Oct 17, 2024
1 parent 4d98b56 commit da1ebcf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
5 changes: 2 additions & 3 deletions scriptsharp/ScriptSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ static class Program

private static async Task Main()
{
UtilsFirebase.InstallFlutterFire();
//LogSingleton.Get.LogAndWriteLine("yo");
//TestDebug();
Utils.CopyMachinePath();
Directory.SetCurrentDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

//clear the log file
LogSingleton.Get.LogAndWriteLine("Bienvenue dans l'installeur pour les cours de mobile");
LogSingleton.Get.LogAndWriteLine("ATTENTION DE BIEN ATTENDRE LA FIN DE L'INSTALLATION AVANT D'OUVRIR UN PROJET");
Expand Down
13 changes: 11 additions & 2 deletions scriptsharp/ScriptSharp/Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public static async Task DownloadRepo(string url, string name)
// download URL_3N5 to the Desktop and unzip it
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string zipFilePath = Path.Combine(desktopPath, name + ".zip");
await Utils.DownloadFileAsync(url, zipFilePath);
await DownloadFileAsync(url, zipFilePath);
LogSingleton.Get.LogAndWriteLine("Dézippage du repo " + zipFilePath + " vers " + desktopPath);
ZipFile.ExtractToDirectory(zipFilePath, desktopPath, true);
try { File.Delete(zipFilePath); }
Expand All @@ -425,5 +425,14 @@ public static async Task DownloadRepo(string url, string name)
}
}

public static async Task DownloadRepoKmb() { await Utils.DownloadRepo(Config.UrlKmb, "KMB"); }
public static async Task DownloadRepoKmb() { await DownloadRepo(Config.UrlKmb, "KMB"); }

public static void CopyMachinePath()
{
string[] machinePaths = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine)!.Split(";");
string[] userPaths = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!.Split(";");
string[] allPaths = machinePaths.Concat(userPaths).ToArray();
string joinedPaths = string.Join(";", allPaths);
SetEnvVariable("Path", joinedPaths);
}
}
1 change: 0 additions & 1 deletion scriptsharp/ScriptSharp/Utils/UtilsAndroidSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace ScriptSharp;

public class UtilsAndroidSdk
{

public static async Task InstallAndroidSdk()
{
LogSingleton.Get.LogAndWriteLine("Installation Android SDK démarré");
Expand Down
3 changes: 2 additions & 1 deletion scriptsharp/ScriptSharp/Utils/UtilsFirebase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static void InstallFirebase()
}
public static void InstallFlutterFire()
{
Utils.RunCommand(UtilsFlutter.PathToDart()+" pub global activate flutterfire_cli");
// Utils.RunCommand("echo %path%");
Utils.RunCommand("dart pub global activate flutterfire_cli");
}
}
2 changes: 1 addition & 1 deletion scriptsharp/ScriptSharp/Utils/UtilsIntellij.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static Task StartIntellij()
{
// start android studio
LogSingleton.Get.LogAndWriteLine("Démarrage d'Intellij IDEA");
string path = UtilsIntellij.PathToIntellij();
string path = PathToIntellij();
Utils.CreateDesktopShortcut("Intellij", path);
if (File.Exists(path))
{
Expand Down

0 comments on commit da1ebcf

Please sign in to comment.