Files
SeedPass/torch/src/cmd-rollback.mjs
T
google-labs-jules[bot]andPR0M3TH3AN 8761455bd4 Install and setup TORCH in torch/ directory
- Added `torch-lock` dependency to `torch/package.json`
- Initialized TORCH structure using `cmdInit` (mocked interaction)
- Updated `torch/package.json` with TORCH CLI scripts (`lock:check`, `lock:lock`, etc.)
- Updated `torch/torch-config.json` with Nostr configuration
- Added `type: module` to `torch/package.json` to support ES modules
- Cleaned up extraneous directories (`test_logs`, `todo`, etc.) from initialization

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-19 20:16:19 +00:00

20 lines
620 B
JavaScript

import { rollbackPrompt } from './services/governance/index.js';
import { ExitError } from './errors.mjs';
export async function cmdRollback(target, strategy) {
if (!target) {
console.error('Usage: torch-lock rollback --target <path> [--strategy <hash|latest>]');
throw new ExitError(1, 'Missing target');
}
const effectiveStrategy = strategy || 'latest';
try {
const result = await rollbackPrompt(target, effectiveStrategy);
console.log(JSON.stringify(result, null, 2));
} catch (e) {
console.error(`Rollback failed: ${e.message}`);
throw new ExitError(1, 'Rollback failed');
}
}