diff --git a/bin/create-probot-app.js b/bin/create-probot-app.js index 7f1533c6e4..d60e96a62b 100755 --- a/bin/create-probot-app.js +++ b/bin/create-probot-app.js @@ -26,6 +26,7 @@ program .option('-h, --homepage ', 'Author\'s homepage') .option('-u, --user ', 'GitHub username or org (repo owner)') .option('-r, --repo ', 'Repository name') + .option('-b, --branch ', 'Specify a branch', 'master') .option('--overwrite', 'Overwrite existing files', false) .option('--template ', 'URL or name of custom template', getTemplateRepository, DEFAULT_TEMPLATE) .option('--typescript', 'Use the TypeScript template', () => program.emit('option:template', 'typescript')) @@ -53,12 +54,12 @@ const prompts = [ message: 'App name:', when: !program.appName, validate (appName) { - const result = validatePackageName(appName); - if(result.errors && result.errors.length > 0) { - return result.errors.join(","); + const result = validatePackageName(appName) + if (result.errors && result.errors.length > 0) { + return result.errors.join(',') } - return true; + return true } }, { @@ -126,7 +127,8 @@ inquirer.prompt(prompts) answers.year = new Date().getFullYear() return scaffold(program.template, destination, answers, { - overwrite: Boolean(program.overwrite) + overwrite: Boolean(program.overwrite), + branch: program.branch }) }) .then(results => { diff --git a/package.json b/package.json index af453c07a4..23e38772ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-probot-app", - "version": "2.1.1", + "version": "2.3.0", "description": "Create a Probot app", "bin": { "create-probot-app": "./bin/create-probot-app.js"