maint: hotreload updated to 1.13.7
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using SingularityGroup.HotReload.Editor.Localization;
|
||||
using SingularityGroup.HotReload.Editor.Semver;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
@@ -38,7 +39,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
return macosVersion;
|
||||
}
|
||||
// should never happen
|
||||
Log.Warning("Failed to detect MacOS version, if Hot Reload fails to start, please contact support.");
|
||||
Log.Warning(Translations.Errors.WarningMacOSVersionDetectionFailed);
|
||||
return SemVersion.None;
|
||||
});
|
||||
|
||||
@@ -84,6 +85,10 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
Arguments = args.cliArguments,
|
||||
UseShellExecute = false,
|
||||
});
|
||||
|
||||
var pidFilePath = CliUtils.GetPidFilePath(args.hotreloadTempDir);
|
||||
// ReSharper disable once PossibleNullReferenceException
|
||||
File.WriteAllText(pidFilePath, process.Id.ToString());
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -114,14 +119,14 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
|
||||
if (process.WaitForExit(1000)) {
|
||||
if (process.ExitCode != 0) {
|
||||
Log.Warning("Failed to the run the start server command. ExitCode={0}\nFilepath: {1}", process.ExitCode, executableScriptPath);
|
||||
Log.Warning(Translations.Errors.WarningFailedToRunServerCommand, process.ExitCode, executableScriptPath);
|
||||
}
|
||||
}
|
||||
else {
|
||||
process.EnableRaisingEvents = true;
|
||||
process.Exited += (_, __) => {
|
||||
if (process.ExitCode != 0) {
|
||||
Log.Warning("Failed to the run the start server command. ExitCode={0}\nFilepath: {1}", process.ExitCode, executableScriptPath);
|
||||
Log.Warning(Translations.Errors.WarningFailedToRunServerCommand, process.ExitCode, executableScriptPath);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -141,11 +146,11 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
static void UnzipMacOsPackage(string zipPath, string unzippedFolderPath) {
|
||||
//Log.Info("UnzipMacOsPackage called with {0}\n workingDirectory = {1}", zipPath, unzippedFolderPath);
|
||||
if (!zipPath.EndsWith(".zip")) {
|
||||
throw new ArgumentException($"Expected to end with .zip, but it was: {zipPath}", nameof(zipPath));
|
||||
throw new ArgumentException(string.Format(Translations.Errors.ExceptionExpectedZipFile, zipPath), nameof(zipPath));
|
||||
}
|
||||
|
||||
if (!File.Exists(zipPath)) {
|
||||
throw new ArgumentException($"zip file not found {zipPath}", nameof(zipPath));
|
||||
throw new ArgumentException(string.Format(Translations.Errors.ExceptionZipFileNotFound, zipPath), nameof(zipPath));
|
||||
}
|
||||
var processStartInfo = new ProcessStartInfo {
|
||||
FileName = "unzip",
|
||||
@@ -158,7 +163,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
Process process = Process.Start(processStartInfo);
|
||||
process.WaitForExit();
|
||||
if (process.ExitCode != 0) {
|
||||
throw new Exception($"unzip failed with ExitCode {process.ExitCode}");
|
||||
throw new Exception(string.Format(Translations.Errors.ExceptionUnzipFailed, process.ExitCode));
|
||||
}
|
||||
//Log.Info($"did unzip to {unzippedFolderPath}");
|
||||
// Move the .app folder to unzippedFolderPath
|
||||
@@ -181,7 +186,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
||||
}
|
||||
|
||||
if (!done) {
|
||||
throw new Exception("Failed to find .app directory and move it to " + destDir);
|
||||
throw new Exception(string.Format(Translations.Errors.ExceptionFailedToFindAppDirectory, destDir));
|
||||
}
|
||||
//Log.Info($"did unzip to {unzippedFolderPath}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user