(_commandOptions)
| 8 | |
| 9 | module.exports = class GitInitTask extends Task { |
| 10 | async run(_commandOptions) { |
| 11 | let commandOptions = _commandOptions || {}; |
| 12 | const { default: chalk } = require('chalk'); |
| 13 | let ui = this.ui; |
| 14 | |
| 15 | if (commandOptions.skipGit) { |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | let hasGit = true; |
| 20 | try { |
| 21 | await this._gitVersion(); |
| 22 | } catch (e) { |
| 23 | hasGit = false; |
| 24 | } |
| 25 | if (!hasGit) { |
| 26 | return; |
| 27 | } |
| 28 | const prependEmoji = require('@ember-tooling/blueprint-model/utilities/prepend-emoji'); |
| 29 | ui.writeLine(''); |
| 30 | ui.writeLine(prependEmoji('🎥', 'Initializing git repository.')); |
| 31 | await this._gitInit(); |
| 32 | await this._gitAdd(); |
| 33 | await this._gitCommit(); |
| 34 | ui.writeLine(chalk.green('Git: successfully initialized.')); |
| 35 | } |
| 36 | |
| 37 | _gitVersion() { |
| 38 | return execa('git', ['--version']); |
nothing calls this directly
no test coverage detected