This commit is contained in:
Raven Scott
2026-05-26 17:58:46 -04:00
parent 014c70ad09
commit 1e3d89e810
9 changed files with 126 additions and 129 deletions
+40 -41
View File
@@ -186,47 +186,46 @@ async function cmdInit(ctx, targetDir = '.') {
}
}
export async function main(ctx, argv = []) {
const sub = (argv[1] || 'help').toLowerCase()
// The coreutils runner executes this file body with `ctx` in scope.
// We run the command logic directly at the bottom (consistent with other commands like appstore).
switch (sub) {
case 'help':
case '--help':
case '-h':
printHelp(argv[0] || 'pear')
break
case 'info':
await cmdInfo(ctx)
break
case 'list':
case 'ls':
await cmdList(ctx)
break
case 'stage':
case 'build':
const target = argv[2] || '.'
if (ctx.pear && ctx.pear.pearBuild) {
console.log(`Attempting stage of ${target} using ctx.pear.pearBuild (early integration)...`)
try {
// In a fuller implementation this would call the build API with proper options.
// For now we surface that the capability exists on ctx.pear.
console.log('ctx.pear.pearBuild is available. Full stage pipeline landing in upcoming plan items.')
console.log('Exposed Pear build surface:', Object.keys(ctx.pear).filter(k => k.toLowerCase().includes('build') || k.toLowerCase().includes('bundle')))
} catch (e) {
console.error('Stage attempt error:', e?.message || e)
}
} else {
console.log('pear stage / build: advanced integration in progress (ctx.pear.pearBuild available).')
console.log('Current exposed packages on ctx.pear:')
await cmdList(ctx)
const sub = (typeof argv !== 'undefined' && argv[1] ? argv[1] : 'help').toLowerCase()
switch (sub) {
case 'help':
case '--help':
case '-h':
printHelp(typeof argv !== 'undefined' ? argv[0] : 'pear')
break
case 'info':
await cmdInfo(ctx)
break
case 'list':
case 'ls':
await cmdList(ctx)
break
case 'stage':
case 'build':
const target = (typeof argv !== 'undefined' ? argv[2] : null) || '.'
if (ctx.pear && ctx.pear.pearBuild) {
console.log(`Attempting stage of ${target} using ctx.pear.pearBuild (early integration)...`)
try {
console.log('ctx.pear.pearBuild is available. Full stage pipeline landing in upcoming plan items.')
console.log('Exposed Pear build surface:', Object.keys(ctx.pear).filter(k => k.toLowerCase().includes('build') || k.toLowerCase().includes('bundle')))
} catch (e) {
console.error('Stage attempt error:', e?.message || e)
}
break
case 'init':
await cmdInit(ctx, argv[2])
break
default:
console.error(`Unknown subcommand: ${sub}`)
printHelp(argv[0] || 'pear')
break
}
} else {
console.log('pear stage / build: advanced integration in progress (ctx.pear.pearBuild available).')
console.log('Current exposed packages on ctx.pear:')
await cmdList(ctx)
}
break
case 'init':
await cmdInit(ctx, (typeof argv !== 'undefined' ? argv[2] : null))
break
default:
console.error(`Unknown subcommand: ${sub}`)
printHelp(typeof argv !== 'undefined' ? argv[0] : 'pear')
break
}