From 5d1cce8c1c070909d0ad30e3c08c4a4807f1a71a Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sat, 26 Nov 2016 17:53:43 +0100 Subject: [PATCH] Respect git ref in error message --- bin/now-deploy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/now-deploy.js b/bin/now-deploy.js index 6c6cd65..169b11c 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -21,8 +21,8 @@ import Now from '../lib' import toHumanPath from '../lib/utils/to-human-path' import promptOptions from '../lib/utils/prompt-options' import {handleError, error} from '../lib/error' +import {onGitHub, isRepoPath, gitPathParts} from '../lib/github' import readMetaData from '../lib/read-metadata' -import {onGitHub, isRepoPath} from '../lib/github' const argv = minimist(process.argv.slice(2), { string: [ @@ -228,7 +228,10 @@ async function sync(token) { // once the deployment has finished gitHubRepo = repo } else if (isRepoPath(rawPath)) { - stopDeployment(`This path neither exists, nor is there a repository named "${rawPath}" on GitHub`) + const gitParts = gitPathParts(rawPath) + const gitRef = gitParts.ref ? `with the ref "${gitParts.ref}" ` : '' + + stopDeployment(`There's no repository named "${gitParts.main}" ${gitRef}on GitHub`) } else { stopDeployment(`Could not read directory ${chalk.bold(path)}`) }