summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/build.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/build.js b/bin/build.js
index 9f3ad1d..a712c12 100644
--- a/bin/build.js
+++ b/bin/build.js
@@ -25,18 +25,17 @@ var buildFunc = function(dir, options) {
})
.then(function(repoID) {
var title = options.title;
+ var githubID = options.github || repoID;
- if (!title) {
- var githubID = options.github || repoID;
-
- if(!githubID) {
- throw new Error('Needs a githubID (username/repo). Either set repo origin to a github repo or use the -g flag');
- }
-
+ if (!title && !githubID) {
+ throw new Error('Needs either a title or a githubID (username/repo).\n'+
+ ' If using github, either set repo origin to a github repo or use the -g flag.\n'+
+ ' For title, use the -t flag.');
+ } else if (!title) {
var parts = githubID.split('/', 2);
var user = parts[0], repo = parts[1];
- title = options.title || utils.titleCase(repo);
+ title = utils.titleCase(repo);
}
return generate.folder(