electrobun 0.0.19-beta.88 → 0.0.19-beta.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bun/core/Updater.ts +22 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, dirname, resolve, basename } from "path";
|
|
2
2
|
import { homedir } from "os";
|
|
3
|
-
import { renameSync, unlinkSync, mkdirSync, rmdirSync, statSync, readdirSync } from "fs";
|
|
3
|
+
import { renameSync, unlinkSync, mkdirSync, rmdirSync, statSync, readdirSync, cpSync } from "fs";
|
|
4
4
|
import tar from "tar";
|
|
5
5
|
import { ZstdInit } from "@oneidentity/zstd-js/wasm";
|
|
6
6
|
import { OS as currentOS, ARCH as currentArch } from '../../shared/platform';
|
|
@@ -439,8 +439,27 @@ const Updater = {
|
|
|
439
439
|
const parentDir = dirname(runningAppBundlePath);
|
|
440
440
|
const newVersionDir = join(parentDir, `app-${latestHash}`);
|
|
441
441
|
|
|
442
|
-
//
|
|
443
|
-
|
|
442
|
+
// Create the versioned directory
|
|
443
|
+
mkdirSync(newVersionDir, { recursive: true });
|
|
444
|
+
|
|
445
|
+
// Copy all contents from the extracted app to the versioned directory
|
|
446
|
+
const files = readdirSync(newAppBundlePath);
|
|
447
|
+
for (const file of files) {
|
|
448
|
+
const srcPath = join(newAppBundlePath, file);
|
|
449
|
+
const destPath = join(newVersionDir, file);
|
|
450
|
+
const stats = statSync(srcPath);
|
|
451
|
+
|
|
452
|
+
if (stats.isDirectory()) {
|
|
453
|
+
// Recursively copy directories
|
|
454
|
+
cpSync(srcPath, destPath, { recursive: true });
|
|
455
|
+
} else {
|
|
456
|
+
// Copy files
|
|
457
|
+
cpSync(srcPath, destPath);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// Remove the extracted app directory
|
|
462
|
+
rmdirSync(newAppBundlePath, { recursive: true });
|
|
444
463
|
|
|
445
464
|
// Create/update the launcher batch file
|
|
446
465
|
const launcherPath = join(parentDir, "run.bat");
|
package/package.json
CHANGED