Skip to content

Commit 1fe5081

Browse files
authored
Merge pull request #37 from Hamdy/master
add yes to sync options
2 parents 2ab5cdd + 30132fb commit 1fe5081

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/commands/drive/sync.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export default {
4141
{name: 'overwrite', default: true, boolean: true},
4242
{name: 'delete', default: true, boolean: true},
4343
{name: 'live', default: false, boolean: true},
44-
{name: 'watch', abbr: 'w', default: false, boolean: true}
44+
{name: 'watch', abbr: 'w', default: false, boolean: true},
45+
{name: 'yes', abbr: 'y', default: false, boolean: true}
4546
],
4647
command: async function (args) {
4748
if (!args._[0]) throw new Error('A source path or URL is required')
@@ -53,10 +54,15 @@ export default {
5354
console.error(chalk.bold(`Source: ${leftArgs.raw}`))
5455
console.error(chalk.bold(`Target: ${rightArgs.raw}`))
5556

56-
var ok = await yesno({
57-
question: `Begin sync? [y/N]`,
58-
defaultValue: false
59-
})
57+
var ok = true
58+
59+
if(!args.yes){
60+
ok = await yesno({
61+
question: `Begin sync? [y/N]`,
62+
defaultValue: false
63+
})
64+
}
65+
6066
if (!rightArgs.isHyper) mkdirp.sync(rightArgs.path)
6167
if (!ok) process.exit(0)
6268
console.error(live ? 'Live syncing (Ctrl+c to exit)...' : 'Syncing...')

0 commit comments

Comments
 (0)