electrobun 0.0.19-beta.35 → 0.0.19-beta.37
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 +41 -0
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";
|
|
@@ -164,11 +165,44 @@ 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
|
+
console.error('This may be caused by Windows Defender or antivirus software quarantining .js files');
|
|
185
|
+
console.error('Try temporarily disabling real-time protection or adding an exclusion for the electrobun directory');
|
|
186
|
+
|
|
187
|
+
// List what was actually extracted for debugging
|
|
188
|
+
try {
|
|
189
|
+
const extractedFiles = readdirSync(join(ELECTROBUN_DEP_PATH, 'dist'));
|
|
190
|
+
console.log('Extracted files:', extractedFiles);
|
|
191
|
+
|
|
192
|
+
// Check if API directory exists but is empty
|
|
193
|
+
const apiPath = join(ELECTROBUN_DEP_PATH, 'dist', 'api');
|
|
194
|
+
if (existsSync(apiPath)) {
|
|
195
|
+
const apiFiles = readdirSync(apiPath);
|
|
196
|
+
console.log('API directory contents:', apiFiles);
|
|
197
|
+
if (apiFiles.length === 0) {
|
|
198
|
+
console.error('API directory is empty - this confirms antivirus is likely quarantining script files');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} catch (e) {
|
|
202
|
+
console.error('Could not list extracted files');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
172
206
|
console.log('Core dependencies downloaded and cached successfully');
|
|
173
207
|
|
|
174
208
|
} catch (error) {
|
|
@@ -233,6 +267,13 @@ async function ensureCEFDependencies() {
|
|
|
233
267
|
await tar.x({
|
|
234
268
|
file: tempFile,
|
|
235
269
|
cwd: join(ELECTROBUN_DEP_PATH, 'dist'),
|
|
270
|
+
preservePaths: false,
|
|
271
|
+
strip: 0,
|
|
272
|
+
// Add Windows-specific options for more robust extraction
|
|
273
|
+
...(OS === 'win' && {
|
|
274
|
+
noMtime: true,
|
|
275
|
+
preserveOwner: false,
|
|
276
|
+
}),
|
|
236
277
|
});
|
|
237
278
|
|
|
238
279
|
// Clean up temp file
|