MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / _gitCommit

Method _gitCommit

lib/tasks/git-init.js:49–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 }
48
49 async _gitCommit() {
50 const template = require('lodash/template');
51 let commitTemplate = fs.readFileSync(path.join(__dirname, '../utilities/COMMIT_MESSAGE.txt'));
52 let commitMessage = template(commitTemplate)(pkg);
53 let env = this.buildGitEnvironment();
54
55 try {
56 return await execa('git', ['commit', '-m', commitMessage], { env });
57 } catch (error) {
58 if (isError(error) && error.message.indexOf('git config --global user') > -1) {
59 env.GIT_COMMITTER_NAME = 'Tomster';
60 env.GIT_COMMITTER_EMAIL = 'tomster@emberjs.com';
61 return execa('git', ['commit', '-m', commitMessage], { env });
62 }
63
64 throw error;
65 }
66 }
67
68 buildGitEnvironment() {
69 // Make sure we merge in the current environment so that git has access to

Callers 2

runMethod · 0.95
git-init-test.jsFile · 0.80

Calls 2

buildGitEnvironmentMethod · 0.95
isErrorFunction · 0.85

Tested by

no test coverage detected