Skip to content

Commit

Permalink
Merge pull request #32 from probot/add-branch-option
Browse files Browse the repository at this point in the history
Add option to scaffold from a specific branch of a repository
  • Loading branch information
tcbyrd authored Jul 18, 2018
2 parents a6dc658 + 52a4b30 commit 032d479
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions bin/create-probot-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ program
.option('-h, --homepage <homepage>', 'Author\'s homepage')
.option('-u, --user <username>', 'GitHub username or org (repo owner)')
.option('-r, --repo <repo-name>', 'Repository name')
.option('-b, --branch <branch-name>', 'Specify a branch', 'master')
.option('--overwrite', 'Overwrite existing files', false)
.option('--template <template-url>', 'URL or name of custom template', getTemplateRepository, DEFAULT_TEMPLATE)
.option('--typescript', 'Use the TypeScript template', () => program.emit('option:template', 'typescript'))
Expand Down Expand Up @@ -54,12 +55,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
}
},
{
Expand Down Expand Up @@ -128,7 +129,8 @@ inquirer.prompt(prompts)
answers.camelCaseAppName = camelCase(answers.appName)

return scaffold(program.template, destination, answers, {
overwrite: Boolean(program.overwrite)
overwrite: Boolean(program.overwrite),
branch: program.branch
})
})
.then(results => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 032d479

Please sign in to comment.