diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/build.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bin/build.js b/bin/build.js index 4f7429a..0384b77 100644 --- a/bin/build.js +++ b/bin/build.js @@ -24,16 +24,19 @@ var buildFunc = function(dir, options) { return null; }) .then(function(repoID) { + var title = options.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'); - } - - var parts = githubID.split('/', 2); - var user = parts[0], repo = parts[1]; + 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]; - var title = options.title || utils.titleCase(repo); + title = utils.titleCase(repo); + } return generate.folder( _.extend(options.options || {}, { @@ -111,4 +114,4 @@ var buildFiles = function(dir, outputFile, options, masterOptions) { module.exports = { folder: buildFunc, files: buildFiles -};
\ No newline at end of file +}; |