Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859// TODO: deprecate Optiqueimport { argument, } from '@optique/core/primitives';// TODO: deprecate Optiqueimport { string, } from '@optique/core/valueparser';// TODO: deprecate Optiqueimport { runSync, } from '@optique/run';import { cp, mkdir,} from 'node:fs/promises';import { basename, join,} from 'node:path';
/** TODO: deprecate Optique Parsed positional path argument from process.argv. @example ```sh backup-path ./some/file-or-dir ``` */const path = runSync( argument(string(),), { programName: 'backup-path', help: 'option', },);
console.log(`Backing up ${path}`,);/** Current ISO timestamp with colons removed, used as the backup subdirectory name */const now = new Date().toISOString() .replaceAll( ':', '',);await mkdir(join( 'bak', now,),);await cp( path, join( 'bak', now, basename(path,), ), { recursive: true, errorOnExist: true, preserveTimestamps: true, },);