From 18c3f4a06f164c652b94fa7dc8d3173805adf34e Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Wed, 4 Dec 2019 20:50:32 +0100 Subject: [PATCH] use a simpler restore flag --- src/handlers.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/handlers.ts b/src/handlers.ts index 8199ec1..cc9e8f3 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -85,6 +85,11 @@ const handlers: Handlers = { if (!config) throw ConfigError checkIfResticIsAvailable() + if(!flags.to) { + console.log(`You need to specify the restore path with --to`.red) + return + } + const locations = parseLocations(flags) for (const [name, location] of Object.entries(locations)) { const baseText = name.green + '\t\t' @@ -105,7 +110,7 @@ const handlers: Handlers = { exec( 'restic', - ['restore', 'latest', '--path', resolve(location.from), ...args], + ['restore', 'latest', '--path', resolve(location.from), '--target', flags.to], { env }, ) w.done(name.green + '\t\tDone 🎉') @@ -240,7 +245,7 @@ export const help = () => { '\n check [-b, --backend] [-a, --all] Check backends' + '\n backup [-l, --location] [-a, --all] Backup all or specified locations' + '\n forget [-l, --location] [-a, --all] [--dry-run] Forget old snapshots according to declared policies' + - '\n restore [-l, --location] [--from backend] [-- --target ] Restore all or specified locations' + + '\n restore [-l, --location] [--from backend] [--to ] Restore all or specified locations' + '\n' + '\n exec [-b, --backend] [-a, --all] -- [native options] Execute native restic command' + '\n' +