electrobun 0.2.0-beta.6 → 0.2.0-beta.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +17 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.2.0-beta.6",
3
+ "version": "0.2.0-beta.7",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",
package/src/cli/index.ts CHANGED
@@ -1592,7 +1592,20 @@ if (commandArg === "init") {
1592
1592
 
1593
1593
  const asarPath = join(appBundleFolderResourcesPath, "app.asar");
1594
1594
  const asarUnpackedPath = join(appBundleFolderResourcesPath, "app.asar.unpacked");
1595
- const zigAsarCli = join(targetPaths.BSPATCH).replace('bspatch', 'zig-asar');
1595
+
1596
+ // Get zig-asar CLI path - on Windows, check if we need the ARM64 version
1597
+ let zigAsarCli = join(targetPaths.BSPATCH).replace('bspatch', 'zig-asar');
1598
+
1599
+ // If the derived path doesn't exist and we're on Windows, try the runtime architecture vendor path
1600
+ if (!existsSync(zigAsarCli) && process.platform === 'win32') {
1601
+ const runtimeArch = process.arch === 'arm64' ? 'arm64' : 'x64';
1602
+ const vendorPath = join(ELECTROBUN_DEP_PATH, 'vendors', 'zig-asar', runtimeArch, 'zig-asar.exe');
1603
+ if (existsSync(vendorPath)) {
1604
+ zigAsarCli = vendorPath;
1605
+ console.log(`Using ${runtimeArch} zig-asar from vendors`);
1606
+ }
1607
+ }
1608
+
1596
1609
  const appDirPath = appBundleAppCodePath;
1597
1610
 
1598
1611
  // Check if app directory exists
@@ -1619,8 +1632,9 @@ if (commandArg === "init") {
1619
1632
  ];
1620
1633
 
1621
1634
  // Add unpack patterns if any
1622
- if (unpackPatterns.length > 0) {
1623
- asarArgs.push("--unpack", unpackPatterns.join(","));
1635
+ // Each pattern needs its own --unpack flag
1636
+ for (const pattern of unpackPatterns) {
1637
+ asarArgs.push("--unpack", pattern);
1624
1638
  }
1625
1639
 
1626
1640
  // Run zig-asar pack