electrobun 0.0.19-beta.36 → 0.0.19-beta.39
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 +45 -22
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -162,17 +162,21 @@ async function ensureCoreDependencies() {
|
|
|
162
162
|
const distPath = join(ELECTROBUN_DEP_PATH, 'dist');
|
|
163
163
|
mkdirSync(distPath, { recursive: true });
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
// Use Windows native tar.exe on Windows due to npm tar library issues
|
|
166
|
+
if (OS === 'win') {
|
|
167
|
+
console.log('Using Windows native tar.exe for reliable extraction...');
|
|
168
|
+
execSync(`tar -xf "${tempFile}" -C "${distPath}"`, {
|
|
169
|
+
stdio: 'inherit',
|
|
170
|
+
cwd: distPath
|
|
171
|
+
});
|
|
172
|
+
} else {
|
|
173
|
+
await tar.x({
|
|
174
|
+
file: tempFile,
|
|
175
|
+
cwd: distPath,
|
|
176
|
+
preservePaths: false,
|
|
177
|
+
strip: 0,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
176
180
|
|
|
177
181
|
// Clean up temp file
|
|
178
182
|
unlinkSync(tempFile);
|
|
@@ -181,10 +185,23 @@ async function ensureCoreDependencies() {
|
|
|
181
185
|
const mainJsPath = join(ELECTROBUN_DEP_PATH, 'dist', 'main.js');
|
|
182
186
|
if (!existsSync(mainJsPath)) {
|
|
183
187
|
console.error('Warning: main.js was not extracted properly');
|
|
188
|
+
console.error('This may be caused by Windows Defender or antivirus software quarantining .js files');
|
|
189
|
+
console.error('Try temporarily disabling real-time protection or adding an exclusion for the electrobun directory');
|
|
190
|
+
|
|
184
191
|
// List what was actually extracted for debugging
|
|
185
192
|
try {
|
|
186
193
|
const extractedFiles = readdirSync(join(ELECTROBUN_DEP_PATH, 'dist'));
|
|
187
194
|
console.log('Extracted files:', extractedFiles);
|
|
195
|
+
|
|
196
|
+
// Check if API directory exists but is empty
|
|
197
|
+
const apiPath = join(ELECTROBUN_DEP_PATH, 'dist', 'api');
|
|
198
|
+
if (existsSync(apiPath)) {
|
|
199
|
+
const apiFiles = readdirSync(apiPath);
|
|
200
|
+
console.log('API directory contents:', apiFiles);
|
|
201
|
+
if (apiFiles.length === 0) {
|
|
202
|
+
console.error('API directory is empty - this confirms antivirus is likely quarantining script files');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
188
205
|
} catch (e) {
|
|
189
206
|
console.error('Could not list extracted files');
|
|
190
207
|
}
|
|
@@ -251,17 +268,23 @@ async function ensureCEFDependencies() {
|
|
|
251
268
|
|
|
252
269
|
// Extract to dist directory
|
|
253
270
|
console.log('Extracting CEF dependencies...');
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
271
|
+
const cefDistPath = join(ELECTROBUN_DEP_PATH, 'dist');
|
|
272
|
+
|
|
273
|
+
// Use Windows native tar.exe on Windows due to npm tar library issues
|
|
274
|
+
if (OS === 'win') {
|
|
275
|
+
console.log('Using Windows native tar.exe for reliable extraction...');
|
|
276
|
+
execSync(`tar -xf "${tempFile}" -C "${cefDistPath}"`, {
|
|
277
|
+
stdio: 'inherit',
|
|
278
|
+
cwd: cefDistPath
|
|
279
|
+
});
|
|
280
|
+
} else {
|
|
281
|
+
await tar.x({
|
|
282
|
+
file: tempFile,
|
|
283
|
+
cwd: cefDistPath,
|
|
284
|
+
preservePaths: false,
|
|
285
|
+
strip: 0,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
265
288
|
|
|
266
289
|
// Clean up temp file
|
|
267
290
|
unlinkSync(tempFile);
|