also looking at this
test: control purge history preparation clock
#55
37 files
+1804
-168
| @@ -0,0 +1,17 @@ | ||
| 1 | import { defineCommand } from '@stacksjs/cli' | |
| 2 | import { printAsync } from '../../resources/functions/cli/output' | |
| 3 | import { storeCommandFailure, storeCommandReference, storeReferenceFlags } from '../../resources/functions/drone/updates/command' | |
| 4 | import { abandonRuntimeFirmwareTrial } from '../../resources/functions/drone/updates/store' | |
| 5 | ||
| 6 | export default defineCommand({ | |
| 7 | name: 'updates:abandon <directory>', | |
| 8 | description: 'Abandon an exact interrupted host trial after metadata recovery while retaining artifacts and known-good state', | |
| 9 | options: { ...storeReferenceFlags, '--trial <id>': 'Exact interrupted host trial identity' }, | |
| 10 | async handle(options, directory) { | |
| 11 | try { | |
| 12 | if (typeof options.trial !== 'string') throw new Error('Explicit interrupted trial required') | |
| 13 | await printAsync(JSON.stringify(await abandonRuntimeFirmwareTrial({ ...storeCommandReference(options, directory), trialId: options.trial }))) | |
| 14 | } | |
| 15 | catch { await storeCommandFailure() } | |
| 16 | }, | |
| 17 | }) | |