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

Method run

lib/tasks/git-init.js:10–35  ·  view source on GitHub ↗
(_commandOptions)

Source from the content-addressed store, hash-verified

8
9module.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']);

Callers

nothing calls this directly

Calls 4

_gitVersionMethod · 0.95
_gitInitMethod · 0.95
_gitAddMethod · 0.95
_gitCommitMethod · 0.95

Tested by

no test coverage detected