Created
April 15, 2014 21:54
-
-
Save franklinjavier/10780464 to your computer and use it in GitHub Desktop.
Using git with Yoeman generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| InfoGenerator.prototype.gitCommit = function gitCommit() { | |
| var done = this.async(); | |
| this.log('\n\nInitializing Git repository. If this fail, try running ' + | |
| chalk.yellow.bold('git init') + | |
| ' and make a first commit manually'); | |
| var async = require('async'); | |
| async.series([ | |
| function (taskDone) { | |
| exec('git init', taskDone); | |
| }, | |
| function (taskDone) { | |
| exec('git add . --all', taskDone); | |
| }, | |
| function (taskDone) { | |
| exec('git commit -m "Created playground"', taskDone); | |
| } | |
| ], function (err) { | |
| console.log(err); | |
| if (err === 127) { | |
| this.log('Could not find the ' + chalk.yellow.bold('git') + ' command. Make sure Git is installed on this machine'); | |
| return; | |
| } | |
| this.log(chalk.green('complete') + ' Git repository has been setup'); | |
| done(); | |
| }.bind(this)); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment