heroku-cli-util
Advanced tools
Comparing version 6.1.15 to 6.1.16
@@ -102,6 +102,16 @@ 'use strict' | ||
function * login (options = {}) { | ||
if (options['sso']) { | ||
return yield loginSSO(options) | ||
} else { | ||
return yield loginUserPass(options) | ||
try { | ||
if (options['sso']) { | ||
return yield loginSSO(options) | ||
} else { | ||
return yield loginUserPass(options) | ||
} | ||
} catch (e) { | ||
const {PromptMaskError} = require('./prompt') | ||
const os = require('os') | ||
if (e instanceof PromptMaskError && os.platform() === 'win32') { | ||
throw new PromptMaskError('Login is currently incompatible with git bash/Cygwin/MinGW') | ||
} else { | ||
throw e | ||
} | ||
} | ||
@@ -108,0 +118,0 @@ } |
@@ -9,2 +9,3 @@ 'use strict' | ||
const Spinner = require('./spinner') | ||
const nodeUtil = require('util') | ||
@@ -81,2 +82,13 @@ function promptMasked (options) { | ||
function PromptMaskError (message) { | ||
Error.call(this) | ||
Error.captureStackTrace(this, this.constructor) | ||
this.name = this.constructor.name | ||
this.message = message | ||
} | ||
nodeUtil.inherits(PromptMaskError, Error) | ||
exports.PromptMaskError = PromptMaskError | ||
function prompt (name, options) { | ||
@@ -90,3 +102,3 @@ options = options || {} | ||
if (!isTTY) { | ||
return Promise.reject(`CLI needs to prompt for ${options.name || options.prompt} but stdin is not a tty.`) | ||
return Promise.reject(new PromptMaskError(`CLI needs to prompt for ${options.name || options.prompt} but stdin is not a tty.`)) | ||
} | ||
@@ -93,0 +105,0 @@ |
{ | ||
"name": "heroku-cli-util", | ||
"description": "Set of helpful CLI utilities", | ||
"version": "6.1.15", | ||
"version": "6.1.16", | ||
"author": "Jeff Dickey (@dickeyxxx)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
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
83576
2848