Got rid of `simple-git` warning (#3405)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js
index ebbfac1..21d37e6 100644
--- a/benchmark/benchmark.js
+++ b/benchmark/benchmark.js
@@ -6,7 +6,7 @@ const crypto = require('crypto');
const { argv } = require('yargs');
const fetch = require('node-fetch').default;
const Benchmark = require('benchmark');
-const simpleGit = require('simple-git/promise');
+const simpleGit = require('simple-git');
const { parseLanguageNames } = require('../tests/helper/test-case');
@@ -401,7 +401,7 @@ async function getCandidates(config) {
const remoteBaseDir = path.join(__dirname, 'remotes');
await fs.promises.mkdir(remoteBaseDir, { recursive: true });
- const baseGit = simpleGit(remoteBaseDir);
+ const baseGit = simpleGit.gitP(remoteBaseDir);
for (const remote of config.remotes) {
const user = /[^/]+(?=\/prism.git)/.exec(remote.repo);
@@ -413,9 +413,9 @@ async function getCandidates(config) {
if (!fs.existsSync(remoteDir)) {
console.log(`Cloning ${remote.repo}`);
await baseGit.clone(remote.repo, remoteName);
- remoteGit = simpleGit(remoteDir);
+ remoteGit = simpleGit.gitP(remoteDir);
} else {
- remoteGit = simpleGit(remoteDir);
+ remoteGit = simpleGit.gitP(remoteDir);
await remoteGit.fetch('origin', branch); // get latest version of branch
}
await remoteGit.checkout(branch); // switch to branch
diff --git a/dangerfile.js b/dangerfile.js
index d9eb8c5..2e5bf39 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -1,7 +1,7 @@
const { markdown } = require('danger');
const fs = require('fs').promises;
const gzipSize = require('gzip-size');
-const git = require('simple-git/promise')(__dirname).silent(true);
+const git = require('simple-git').gitP(__dirname);
/**
* Returns the contents of a text file in the base of the PR.
diff --git a/gulpfile.js/changelog.js b/gulpfile.js/changelog.js
index 88597ba..fc21879 100644
--- a/gulpfile.js/changelog.js
+++ b/gulpfile.js/changelog.js
@@ -4,7 +4,7 @@ const { src, dest } = require('gulp');
const replace = require('gulp-replace');
const pump = require('pump');
-const git = require('simple-git/promise')(__dirname);
+const git = require('simple-git').gitP(__dirname);
const { changelog } = require('./paths');