Commit 76050e6fc473fac32ae36c1825294efdd0574b70

Michael Schmidt 2022-03-21T20:38:26

Got rid of `simple-git` warning (#3405)

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');