mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-22 15:40:31 -04:00
Fix updater being broken after restart
This commit is contained in:
@@ -272,12 +272,15 @@ public abstract class OperationMode {
|
||||
return;
|
||||
}
|
||||
|
||||
inShutdown = true;
|
||||
try {
|
||||
if (CURRENT != null) {
|
||||
CURRENT.finalTeardown();
|
||||
if (!isInStartup()) {
|
||||
inShutdown = true;
|
||||
if (CURRENT != null) {
|
||||
CURRENT.finalTeardown();
|
||||
}
|
||||
CURRENT = null;
|
||||
}
|
||||
CURRENT = null;
|
||||
|
||||
// Restart local shell
|
||||
LocalShell.init();
|
||||
r.run();
|
||||
|
||||
@@ -35,15 +35,17 @@ public class AppDownloads {
|
||||
}
|
||||
|
||||
var downloadFile = FileUtils.getTempDirectory().toPath().resolve(release.getFile());
|
||||
Files.write(downloadFile, response.body());
|
||||
// Fix file name to not be included in temp dir clean
|
||||
var fixedFile = Path.of(downloadFile.toString().replaceAll("-", "_"));
|
||||
Files.write(fixedFile, response.body());
|
||||
TrackEvent.withInfo("Downloaded asset")
|
||||
.tag("version", version)
|
||||
.tag("url", release.getUrl())
|
||||
.tag("size", FileUtils.byteCountToDisplaySize(response.body().length))
|
||||
.tag("target", downloadFile)
|
||||
.tag("target", fixedFile)
|
||||
.handle();
|
||||
|
||||
return downloadFile;
|
||||
return fixedFile;
|
||||
} catch (IOException ex) {
|
||||
// All sorts of things can go wrong when downloading, this is expected
|
||||
ErrorEventFactory.expected(ex);
|
||||
|
||||
@@ -15,7 +15,9 @@ public class LocalShell {
|
||||
private static boolean powershellInitialized;
|
||||
|
||||
public static synchronized void init() throws Exception {
|
||||
local = ProcessControlProvider.get().createLocalProcessControl(false).start();
|
||||
if (local == null) {
|
||||
local = ProcessControlProvider.get().createLocalProcessControl(false).start();
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void reset(boolean force) {
|
||||
|
||||
Reference in New Issue
Block a user