mirror of
https://github.com/affaan-m/ECC.git
synced 2026-08-17 21:15:40 +02:00
* feat(install): add guided Claude plugin setup * fix: support Claude command shims on Windows * feat: support safe Claude plugin scope migration * fix(install): preserve interactive setup terminal * fix(install): auto-migrate setup scope changes * feat(install): add guided multi-harness installer * fix(install): sync Yarn binary metadata * fix(install): handle wizard EOF on Node 18 * ci: allow installer matrix tests to finish * test(install): allow slower PowerShell delegation * fix(install): harden guided provider reconciliation * test(install): harden packaged and local compatibility * chore: prepare guided installer release 2.2.0 * fix(install): report refreshed Codex marketplace state * fix(install): verify managed content provenance * test(install): allow empty Yarn smoke fixture * test(install): invoke Windows package shims safely * fix(install): close cross-platform release gaps * fix(install): require trusted GitHub origins * fix(install): preserve hook profile precedence * refactor(install): centralize trusted GitHub origins * ci: retrigger workflow run after merge of main Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
70 lines
1.6 KiB
JavaScript
70 lines
1.6 KiB
JavaScript
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
const {
|
|
ECC_VERSION_PATTERN,
|
|
renderTerminalWelcome,
|
|
} = require('./lib/terminal-welcome');
|
|
|
|
const VALID_ACTIONS = new Set([
|
|
'installed',
|
|
'updated',
|
|
'configured',
|
|
'migrated',
|
|
'resumed',
|
|
'already-migrated',
|
|
]);
|
|
|
|
function parseArgs(argv) {
|
|
let action = 'installed';
|
|
let version;
|
|
|
|
for (let index = 0; index < argv.length; index += 1) {
|
|
const argument = argv[index];
|
|
if (argument === '--action') {
|
|
const value = argv[index + 1];
|
|
if (!value || value.startsWith('--')) {
|
|
throw new Error('Missing value for --action');
|
|
}
|
|
action = value;
|
|
index += 1;
|
|
} else if (argument === '--version') {
|
|
const value = argv[index + 1];
|
|
if (!value || value.startsWith('--')) {
|
|
throw new Error('Missing value for --version');
|
|
}
|
|
version = value;
|
|
index += 1;
|
|
} else {
|
|
throw new Error('Unknown argument');
|
|
}
|
|
}
|
|
|
|
if (!VALID_ACTIONS.has(action)) {
|
|
throw new Error('Invalid --action value');
|
|
}
|
|
if (version !== undefined && !ECC_VERSION_PATTERN.test(version)) {
|
|
throw new Error('Invalid --version value');
|
|
}
|
|
return { action, version };
|
|
}
|
|
|
|
function main(argv = process.argv.slice(2)) {
|
|
try {
|
|
const { action, version } = parseArgs(argv);
|
|
const color = process.env.NO_COLOR === undefined
|
|
&& process.env.TERM !== 'dumb'
|
|
&& Boolean(process.stdout.isTTY);
|
|
process.stdout.write(renderTerminalWelcome({ action, color, version }));
|
|
} catch (error) {
|
|
process.stderr.write(`Error: ${error.message}\n`);
|
|
process.exitCode = 1;
|
|
}
|
|
}
|
|
|
|
if (require.main === module) {
|
|
main();
|
|
}
|
|
|
|
module.exports = { main, parseArgs };
|