()
| 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 |
no test coverage detected