Comparing version 1.0.3 to 1.0.4
@@ -48,7 +48,7 @@ 'use strict'; | ||
if (!force && cloc) { | ||
if (!force && cloc !== process.cwd()) { | ||
console.log(); | ||
console.log(chalk.bold.red('Oops!')); | ||
console.log(); | ||
console.log(`A stdlib workspace already exists.`); | ||
console.log(`A stdlib workspace already exists above this one.`); | ||
console.log(`We recommend you do not initialize another.`); | ||
@@ -55,0 +55,0 @@ console.log(`The path of the stdlib workspace is:`) |
@@ -8,2 +8,3 @@ 'use strict'; | ||
const chalk = require('chalk'); | ||
const inquirer = require('inquirer'); | ||
@@ -54,2 +55,3 @@ let formatDigits = (num, figs) => { | ||
set: '<key> <value> Sets a specified key-value pair', | ||
'new-password': 'Sets a new password via a prompt', | ||
'reset-password': '<email> Sends a password reset request for the specified e-mail address' | ||
@@ -92,2 +94,52 @@ } | ||
if (params.vflags['new-password']) { | ||
return inquirer.prompt( | ||
[ | ||
{ | ||
name: 'password', | ||
type: 'password', | ||
default: '', | ||
message: 'New Password' | ||
}, | ||
{ | ||
name: 'repeat_password', | ||
type: 'password', | ||
default: '', | ||
message: 'Repeat Password' | ||
} | ||
], | ||
(promptResult) => { | ||
resource.request('v1/users').index({me: true}, (err, response) => { | ||
if (err) { | ||
return callback(err); | ||
} | ||
let user = response.data[0]; | ||
if (!user) { | ||
return callback(new Error('We couldn\'t retrieve your user data. Try again shortly.')); | ||
} | ||
resource.request('v1/users').update(user.id, {}, promptResult, (err, response) => { | ||
if (err) { | ||
return callback(err); | ||
} | ||
let user = response.data[0]; | ||
if (!user) { | ||
return callback(new Error('We couldn\'t change your password. Try again shortly.')); | ||
} | ||
return callback(null, 'Password changed successfully.'); | ||
}); | ||
}); | ||
} | ||
); | ||
} | ||
let set = params.vflags.set || params.flags.s || []; | ||
@@ -99,2 +151,5 @@ let update = null; | ||
update[set[0]] = set.slice(1).join(' '); | ||
if (update.password) { | ||
return callback(new Error('Please use --new-password to set your password')); | ||
} | ||
} | ||
@@ -101,0 +156,0 @@ |
{ | ||
"name": "lib", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Standard Library for Microservices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73355
1609