Skip to content

Commit

Permalink
Offer to create git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminreid committed Mar 2, 2017
1 parent ab101c6 commit 7f940c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ npm install -g yo
This is not available on `npm` _yet_. So for now, clone the project down and inside the folder run.

```
npm install
npm link
```

Expand Down
11 changes: 11 additions & 0 deletions generators/base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@ module.exports = class extends Generator {
message: 'Which version of Node do you want to use?',
default: '6.9.5',
},
{
type: 'confirm',
name: 'createGit',
message: 'Create a local git repo?',
default: true,
},
]).then((answers) => {
this.nodeVersion = answers.nodeVersion;
this.createGit = answers.createGit;
});
}

writing() {
if (this.createGit) {
this.composeWith(require.resolve('generator-git-init'));
}

// write node verison
this.fs.copyTpl(
this.templatePath('.nvmrc'),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"yeoman-generator"
],
"dependencies": {
"generator-git-init": "^1.1.3",
"yeoman-generator": "^1.1.0"
}
}

0 comments on commit 7f940c8

Please sign in to comment.