Comparing version 3.1.8 to 3.1.9
@@ -114,5 +114,18 @@ const assert = require('assert'); | ||
fs.mkdirSync(tmp_dir); | ||
proc.spawnSync('git', ['clone', args.GITHUB_REPO, tmp_dir], { | ||
cwd: process.cwd(), env: process.env, stdio: 'ignore', shell: isWindows || undefined, | ||
const output = proc.spawnSync('git', ['clone', args.GITHUB_REPO, tmp_dir], { | ||
cwd: process.cwd(), env: process.env, shell: isWindows || undefined, | ||
}); | ||
if (output.stderr && output.stderr.toString().toLowerCase().includes('authentication failed')) { | ||
throw new Error('Error accessing plugin repository - The GitHub username and password were incorrect.'); | ||
} | ||
if (output.stderr && output.stderr.toString().toLowerCase().includes('enabled or enforced saml sso')) { | ||
const parsedOutput = output.stderr.toString().match(/(https:\/\/github.com.*)\s/); | ||
if (parsedOutput.length < 2) { | ||
throw new Error('Error accessing plugin repository - SSO authentication needed.\n\nFor more information, see https://help.github.com/en/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on\n'); | ||
} | ||
throw new Error(`Error accessing plugin repository - SSO authentication needed\n\nVisit ${parsedOutput[1]} and try your request again.\n\nFor more information, see https://help.github.com/en/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on\n`); | ||
} | ||
if (fs.statSync(path.join(tmp_dir, 'index.js')).isFile()) { | ||
@@ -119,0 +132,0 @@ try { |
{ | ||
"name": "akkeris", | ||
"version": "3.1.8", | ||
"version": "3.1.9", | ||
"description": "Akkeris CLI", | ||
@@ -5,0 +5,0 @@ "main": "aka.js", |
268919
7253