Comparing version 2.0.2 to 2.0.3
@@ -31,12 +31,14 @@ 'use strict'; | ||
var buildOptions = function buildOptions(password, verbose) { | ||
return { | ||
transifex: { | ||
password: password | ||
}, | ||
verbose: verbose | ||
}; | ||
}; | ||
var askForPassword = function askForPassword(fn) { | ||
(0, _read2.default)({ prompt: 'Password: ', silent: true }, function (er, password) { | ||
var options = { | ||
transifex: { | ||
password: password | ||
}, | ||
verbose: args.verbose | ||
}; | ||
var options = buildOptions(password, args.verbose); | ||
fn(options); | ||
@@ -47,11 +49,19 @@ }); | ||
if (args._[0] === 'pull') { | ||
askForPassword(function (options) { | ||
api.pull(options); | ||
}); | ||
if (!args.password) { | ||
askForPassword(function (options) { | ||
api.pull(options); | ||
}); | ||
} else { | ||
api.pull(buildOptions(args.password, args.verbose)); | ||
} | ||
} | ||
if (args._[0] === 'push') { | ||
askForPassword(function (options) { | ||
api.push(options); | ||
}); | ||
if (!args.password) { | ||
askForPassword(function (options) { | ||
api.push(options); | ||
}); | ||
} else { | ||
api.push(buildOptions(args.password, args.verbose)); | ||
} | ||
} |
{ | ||
"name": "narp", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "The worlds best super translation manager package handler", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
14827
274