Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreOlivierBrillant committed Oct 16, 2024
2 parents 6dc6a57 + 70caff2 commit c423b4b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions scriptsharp/ScriptSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static async Task DownloadRepo(string url, string name)
await Utils.DownloadFileAsync(url, zipFilePath);
Utils.LogAndWriteLine("Dézippage du repo " + zipFilePath + " vers " + desktopPath);
ZipFile.ExtractToDirectory(zipFilePath, desktopPath, true);
File.Delete(zipFilePath);
try { File.Delete(zipFilePath); }catch { }
}

// TODO split copy and unzip to start other download while unzipping
Expand Down Expand Up @@ -174,7 +174,6 @@ public static async Task InstallAndroidStudio()
string destinationFolder = Path.Combine(desktopPath);
await Utils.Unzip7zFileAsync(Path.Combine(Config.localTemp,"android-studio.7z"), destinationFolder);
// TODO add shortcut
Utils.CreateDesktopShortcut("Android-Studio", Path.Combine(desktopPath, "android-studio", "bin", "studio64.exe"));
Utils.AddToPath(Path.Combine(desktopPath, "android-studio", "bin"));
Utils.LogAndWriteLine(" FAIT Installation Android Studio fini");
}
Expand Down
1 change: 0 additions & 1 deletion scriptsharp/ScriptSharp/Script3N5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ await Task.WhenAll(
"idea")
),
Program.InstallJava() );
Utils.CreateDesktopShortcut("IntelliJ", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "idea", "bin", "idea64.exe"));
Utils.AddToPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "idea", "bin"));
Utils.LogAndWriteLine("Premier gradle build pour constituer le .gradle");
// install plugins TODO ? one day?
Expand Down
4 changes: 2 additions & 2 deletions scriptsharp/ScriptSharp/Script5N6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ await Task.WhenAll(
Utils.RunCommand("studio64.exe installPlugins io.flutter");
Utils.RunCommand("studio64.exe installPlugins com.github.copilot");
Utils.RunCommand("studio64.exe installPlugins com.localizely.flutter-intl");
await Utils.StartAndroidStudio();
await InstallFlutter();
Utils.StartKMB();
await Utils.StartAndroidStudio();
Utils.LogAndWriteLine(" FAIT 5N6 Flutter complet");
}

Expand Down Expand Up @@ -102,13 +102,13 @@ await Task.WhenAll(
Utils.RunCommand("studio64.exe installPlugins io.flutter");
Utils.RunCommand("studio64.exe installPlugins com.github.copilot");
Utils.RunCommand("studio64.exe installPlugins com.localizely.flutter-intl");
await Utils.StartAndroidStudio();
await InstallFlutter();
Utils.StartKMB();
Utils.AddToPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData",
"Local", "Pub", "Cache", "bin"));
Utils.RunCommand("npm install -g firebase-tools");
Utils.RunCommand("dart pub global activate flutterfire_cli");
await Utils.StartAndroidStudio();
Utils.LogAndWriteLine(" FAIT 5N6 Flutter + firebase complet");
}

Expand Down
6 changes: 5 additions & 1 deletion scriptsharp/ScriptSharp/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public static async Task StartIntellij()
LogAndWriteLine("Démarrage d'Intellij IDEA");
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string path = Path.Combine(desktopPath, "idea","bin","idea64.exe");
CreateDesktopShortcut("Intellij", path);
if (File.Exists(path))
{
ProcessStartInfo processStartInfo = new ProcessStartInfo
Expand All @@ -328,6 +329,7 @@ public static async Task StartAndroidStudio()
string androidStudioPath = Path.Combine(desktopPath, "android-studio","bin","studio64.exe");
if (File.Exists(androidStudioPath))
{
CreateDesktopShortcut("Android-Studio", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "android-studio", "bin", "studio64.exe"));
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
FileName = androidStudioPath,
Expand Down Expand Up @@ -381,6 +383,8 @@ public static void DeleteAll()
DeleteThis(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
DeleteThis(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".android"));
DeleteThis(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gradle"));
// quit the app
System.Environment.Exit(0);
}

private static void DeleteThis(string path)
Expand All @@ -390,7 +394,7 @@ private static void DeleteThis(string path)
{ Directory.Delete(path, true); }
}
catch (Exception ex)
{ LogAndWriteLine($"An error occurred while deleting the directory: {ex.Message}"); }
{ Console.WriteLine($"An error occurred while deleting the directory {path}: {ex.Message} {ex.Data}"); }
}
}

0 comments on commit c423b4b

Please sign in to comment.