From dded186b959294f31cfc4723b45d46ab441d02e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Harper?= Date: Tue, 11 Dec 2018 16:05:56 -0500 Subject: [PATCH] fix an error when there is a package.json but no repo url --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ced2f08..f9a16c4 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,7 @@ var repo = yargs.argv._[0] if (!repo) { try { repo = require(path.join(process.cwd(), 'package.json')).repository - repo = repo.url || repo + repo = repo && repo.url ? repo.url : repo console.warn('Using project repo from package.json') } catch (e) { console.error(e) } }