4runr-os 2.1.34 → 2.1.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/scripts/setup.js +54 -49
package/package.json
CHANGED
package/scripts/setup.js
CHANGED
|
@@ -313,65 +313,70 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
|
|
|
313
313
|
console.warn(' rustup default stable-x86_64-pc-windows-gnu');
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
}
|
|
317
316
|
|
|
318
|
-
// Check if 4runr-os is installed
|
|
319
|
-
try {
|
|
320
|
-
execSync('4r --version', { stdio: 'ignore' });
|
|
321
|
-
console.log('✅ 4runr-os is installed');
|
|
322
|
-
} catch {
|
|
323
|
-
console.log('⚠️ 4runr-os not found in PATH');
|
|
324
|
-
console.log(' Installing 4runr-os...');
|
|
317
|
+
// Check if 4runr-os is installed
|
|
325
318
|
try {
|
|
326
|
-
execSync('
|
|
327
|
-
console.log('✅ 4runr-os installed');
|
|
319
|
+
execSync('4r --version', { stdio: 'ignore' });
|
|
320
|
+
console.log('✅ 4runr-os is installed');
|
|
328
321
|
} catch {
|
|
329
|
-
console.
|
|
330
|
-
console.
|
|
331
|
-
|
|
322
|
+
console.log('⚠️ 4runr-os not found in PATH');
|
|
323
|
+
console.log(' Installing 4runr-os...');
|
|
324
|
+
try {
|
|
325
|
+
execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
|
|
326
|
+
console.log('✅ 4runr-os installed');
|
|
327
|
+
} catch {
|
|
328
|
+
console.error('❌ Failed to install 4runr-os');
|
|
329
|
+
console.error(' Run manually: npm install -g 4runr-os@latest');
|
|
330
|
+
process.exit(1);
|
|
331
|
+
}
|
|
332
332
|
}
|
|
333
|
-
}
|
|
334
333
|
|
|
335
|
-
// Verify mk3-tui binary (check global install location)
|
|
336
|
-
let mk3Dir = null;
|
|
337
|
-
try {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
334
|
+
// Verify mk3-tui binary (check global install location)
|
|
335
|
+
let mk3Dir = null;
|
|
336
|
+
try {
|
|
337
|
+
// Try to find global install location
|
|
338
|
+
const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8' }).trim();
|
|
339
|
+
const globalPath = isWindows
|
|
340
|
+
? path.join(npmPrefix, 'node_modules', '4runr-os', 'mk3-tui')
|
|
341
|
+
: path.join(npmPrefix, 'lib', 'node_modules', '4runr-os', 'mk3-tui');
|
|
342
|
+
|
|
343
|
+
if (fs.existsSync(globalPath)) {
|
|
344
|
+
mk3Dir = globalPath;
|
|
345
|
+
}
|
|
346
|
+
} catch {
|
|
347
|
+
// Fallback to local
|
|
348
|
+
mk3Dir = path.join(__dirname, '..', 'mk3-tui');
|
|
346
349
|
}
|
|
347
|
-
} catch {
|
|
348
|
-
// Fallback to local
|
|
349
|
-
mk3Dir = path.join(__dirname, '..', 'mk3-tui');
|
|
350
|
-
}
|
|
351
350
|
|
|
352
|
-
if (mk3Dir && fs.existsSync(mk3Dir)) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
351
|
+
if (mk3Dir && fs.existsSync(mk3Dir)) {
|
|
352
|
+
const binaryName = isWindows ? 'mk3-tui.exe' : 'mk3-tui';
|
|
353
|
+
const binaryPath = path.join(mk3Dir, 'target', 'release', binaryName);
|
|
354
|
+
|
|
355
|
+
if (!fs.existsSync(binaryPath)) {
|
|
356
|
+
console.log('\n🔨 Building mk3-tui binary...');
|
|
357
|
+
try {
|
|
358
|
+
execSync('cargo build --release', {
|
|
359
|
+
cwd: mk3Dir,
|
|
360
|
+
stdio: 'inherit',
|
|
361
|
+
});
|
|
362
|
+
console.log('✅ mk3-tui built successfully');
|
|
363
|
+
} catch (error) {
|
|
364
|
+
console.warn('⚠️ Failed to build mk3-tui');
|
|
365
|
+
console.warn(' The binary will be built automatically on first run of 4r');
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
console.log('✅ mk3-tui binary found');
|
|
367
369
|
}
|
|
368
370
|
} else {
|
|
369
|
-
console.log('
|
|
371
|
+
console.log('⚠️ mk3-tui source not found - will build on first run of 4r');
|
|
370
372
|
}
|
|
371
|
-
|
|
372
|
-
console.log('
|
|
373
|
+
|
|
374
|
+
console.log('\n✅ Setup complete! You can now run: 4r\n');
|
|
373
375
|
}
|
|
374
376
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
+
// Run the setup
|
|
378
|
+
runSetup().catch((error) => {
|
|
379
|
+
console.error('\n❌ Setup failed:', error);
|
|
380
|
+
process.exit(1);
|
|
381
|
+
});
|
|
377
382
|
|