electrobun 0.0.19-beta.34 → 0.0.19-beta.36
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/package.json +1 -1
- package/src/cli/index.ts +30 -2
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
mkdirSync,
|
|
8
8
|
createWriteStream,
|
|
9
9
|
unlinkSync,
|
|
10
|
+
readdirSync,
|
|
10
11
|
} from "fs";
|
|
11
12
|
import { execSync } from "child_process";
|
|
12
13
|
import tar from "tar";
|
|
@@ -128,7 +129,7 @@ async function ensureCoreDependencies() {
|
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
const platformName = OS === 'macos' ? 'darwin' : OS === 'win' ? '
|
|
132
|
+
const platformName = OS === 'macos' ? 'darwin' : OS === 'win' ? 'win' : 'linux';
|
|
132
133
|
const archName = ARCH;
|
|
133
134
|
const coreTarballUrl = `https://github.com/blackboardsh/electrobun/releases/download/${version}/electrobun-core-${platformName}-${archName}.tar.gz`;
|
|
134
135
|
|
|
@@ -164,11 +165,31 @@ async function ensureCoreDependencies() {
|
|
|
164
165
|
await tar.x({
|
|
165
166
|
file: tempFile,
|
|
166
167
|
cwd: distPath,
|
|
168
|
+
preservePaths: false,
|
|
169
|
+
strip: 0,
|
|
170
|
+
// Add Windows-specific options for more robust extraction
|
|
171
|
+
...(OS === 'win' && {
|
|
172
|
+
noMtime: true,
|
|
173
|
+
preserveOwner: false,
|
|
174
|
+
}),
|
|
167
175
|
});
|
|
168
176
|
|
|
169
177
|
// Clean up temp file
|
|
170
178
|
unlinkSync(tempFile);
|
|
171
179
|
|
|
180
|
+
// Verify extraction completed successfully
|
|
181
|
+
const mainJsPath = join(ELECTROBUN_DEP_PATH, 'dist', 'main.js');
|
|
182
|
+
if (!existsSync(mainJsPath)) {
|
|
183
|
+
console.error('Warning: main.js was not extracted properly');
|
|
184
|
+
// List what was actually extracted for debugging
|
|
185
|
+
try {
|
|
186
|
+
const extractedFiles = readdirSync(join(ELECTROBUN_DEP_PATH, 'dist'));
|
|
187
|
+
console.log('Extracted files:', extractedFiles);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.error('Could not list extracted files');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
172
193
|
console.log('Core dependencies downloaded and cached successfully');
|
|
173
194
|
|
|
174
195
|
} catch (error) {
|
|
@@ -200,7 +221,7 @@ async function ensureCEFDependencies() {
|
|
|
200
221
|
}
|
|
201
222
|
}
|
|
202
223
|
|
|
203
|
-
const platformName = OS === 'macos' ? 'darwin' : OS === 'win' ? '
|
|
224
|
+
const platformName = OS === 'macos' ? 'darwin' : OS === 'win' ? 'win' : 'linux';
|
|
204
225
|
const archName = ARCH;
|
|
205
226
|
const cefTarballUrl = `https://github.com/blackboardsh/electrobun/releases/download/${version}/electrobun-cef-${platformName}-${archName}.tar.gz`;
|
|
206
227
|
|
|
@@ -233,6 +254,13 @@ async function ensureCEFDependencies() {
|
|
|
233
254
|
await tar.x({
|
|
234
255
|
file: tempFile,
|
|
235
256
|
cwd: join(ELECTROBUN_DEP_PATH, 'dist'),
|
|
257
|
+
preservePaths: false,
|
|
258
|
+
strip: 0,
|
|
259
|
+
// Add Windows-specific options for more robust extraction
|
|
260
|
+
...(OS === 'win' && {
|
|
261
|
+
noMtime: true,
|
|
262
|
+
preserveOwner: false,
|
|
263
|
+
}),
|
|
236
264
|
});
|
|
237
265
|
|
|
238
266
|
// Clean up temp file
|