mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
* Update simple-git 1.116.0 -> 3.10.0 (#137232) * Updates simple-git to 3.10.0 * Replaces deprecated simple-git imports. Adds needed null check for git status. * Updated simple-git package dep with caret. * Fixes call to deprecated simple-git function prototype.
This commit is contained in:
parent
9ba0ae647d
commit
0493e15a95
5 changed files with 43 additions and 20 deletions
|
@ -801,8 +801,7 @@
|
|||
"sass-loader": "^10.2.0",
|
||||
"sass-resources-loader": "^2.0.1",
|
||||
"selenium-webdriver": "^4.3.1",
|
||||
"serve-static": "1.14.1",
|
||||
"simple-git": "1.116.0",
|
||||
"simple-git": "^3.10.0",
|
||||
"sinon": "^7.4.2",
|
||||
"sort-package-json": "^1.53.1",
|
||||
"spawn-sync": "^1.0.15",
|
||||
|
|
|
@ -12,7 +12,7 @@ import os from 'os';
|
|||
import crypto from 'crypto';
|
||||
|
||||
import chalk from 'chalk';
|
||||
import simpleGit from 'simple-git/promise';
|
||||
import simpleGit from 'simple-git';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
|
||||
import { installArchive } from './install_archive';
|
||||
|
@ -81,6 +81,10 @@ async function sourceInfo(cwd: string, license: string, log: ToolingLog = defaul
|
|||
const { task, ext } = archiveForPlatform(os.platform(), license);
|
||||
const status = await git.status();
|
||||
const branch = status.current;
|
||||
if (branch === null) {
|
||||
throw new Error(`${cwd} git status is null`);
|
||||
}
|
||||
|
||||
const sha = (await git.revparse(['HEAD'])).trim();
|
||||
|
||||
log.info('on %s at %s', chalk.bold(branch), chalk.bold(sha));
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import SimpleGit from 'simple-git/promise';
|
||||
import SimpleGit from 'simple-git';
|
||||
|
||||
import { run, combineErrors, createFlagError, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import * as Eslint from './eslint';
|
||||
|
|
|
@ -21,18 +21,17 @@ export async function gitInfo() {
|
|||
sha: process.env.GIT_COMMIT || process.env.BUILDKITE_COMMIT || 'none',
|
||||
};
|
||||
}
|
||||
const git = simpleGit(gitDir);
|
||||
|
||||
const log = await simpleGit(gitDir).log();
|
||||
|
||||
return new Promise<{ number: number; sha: string }>((resolve, reject) => {
|
||||
git.log((err: undefined | Error, log: { total: number; latest: { hash: string } }) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve({
|
||||
number: log.total,
|
||||
sha: log.latest.hash,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!log.latest) {
|
||||
reject();
|
||||
} else {
|
||||
resolve({
|
||||
number: log.total,
|
||||
sha: log.latest.hash,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
31
yarn.lock
31
yarn.lock
|
@ -3150,6 +3150,18 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kwsites/file-exists@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99"
|
||||
integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==
|
||||
dependencies:
|
||||
debug "^4.1.1"
|
||||
|
||||
"@kwsites/promise-deferred@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919"
|
||||
integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==
|
||||
|
||||
"@loaders.gl/core@2.3.1", "@loaders.gl/core@^2.3.1":
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@loaders.gl/core/-/core-2.3.1.tgz#147037e17b014528dce00187aac0ec6ccb05938b"
|
||||
|
@ -11485,6 +11497,13 @@ debug@4.3.2:
|
|||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debug@^4.3.4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debuglog@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
|
||||
|
@ -25425,12 +25444,14 @@ simple-get@^3.0.3, simple-get@^3.1.0:
|
|||
once "^1.3.1"
|
||||
simple-concat "^1.0.0"
|
||||
|
||||
simple-git@1.116.0:
|
||||
version "1.116.0"
|
||||
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.116.0.tgz#ea6e533466f1e0152186e306e004d4eefa6e3e00"
|
||||
integrity sha512-Pbo3tceqMYy0j3U7jzMKabOWcx5+67GdgQUjpK83XUxGhA+1BX93UPvlWNzbCRoFwd7EJTyDSCC2XCoT4NTLYQ==
|
||||
simple-git@^3.10.0:
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.10.0.tgz#f20031dd121d3c49e215ef0186a102bece3f89b2"
|
||||
integrity sha512-2w35xrS5rVtAW0g67LqtxCZN5cdddz/woQRfS0OJXaljXEoTychZ4jnE+CQgra/wX4ZvHeiChTUMenCwfIYEYw==
|
||||
dependencies:
|
||||
debug "^4.0.1"
|
||||
"@kwsites/file-exists" "^1.1.1"
|
||||
"@kwsites/promise-deferred" "^1.1.1"
|
||||
debug "^4.3.4"
|
||||
|
||||
simple-swizzle@^0.2.2:
|
||||
version "0.2.2"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue