Initial project outline
- package.json (ESM, bin entry) - bin/delta-backup.js — entrypoint - lib/args.js — CLI arg parsing via Node parseArgs - lib/config.js — config file merging + required path guards - lib/spawn.js — safe process spawning (no shell strings) - lib/state.js — sequence number + phase state management - lib/backends/zstd.js — zstd delta backend - lib/backends/index.js — backend registry - lib/commands/run.js — full run skeleton (phases 1-3 wired, 4-6 stubbed) - lib/commands/status.js — status command
This commit is contained in:
22
bin/delta-backup.js
Normal file
22
bin/delta-backup.js
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env node
|
||||
import { parseArgs } from '../lib/args.js';
|
||||
import { loadConfig } from '../lib/config.js';
|
||||
import { runCommand } from '../lib/commands/run.js';
|
||||
import { statusCommand } from '../lib/commands/status.js';
|
||||
|
||||
const args = parseArgs(process.argv.slice(2));
|
||||
const config = await loadConfig(args);
|
||||
|
||||
const commands = {
|
||||
run: runCommand,
|
||||
status: statusCommand,
|
||||
};
|
||||
|
||||
const cmd = commands[config.command];
|
||||
if (!cmd) {
|
||||
console.error(`Unknown command: ${config.command}`);
|
||||
console.error('Available commands: run, status');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await cmd(config);
|
||||
Reference in New Issue
Block a user