Skip to content

Commit

Permalink
Update dependency simple-git to v3.14.0 (#41)
Browse files Browse the repository at this point in the history
* Update dependency simple-git to v3.14.0

* Update dist

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sqbot <[email protected]>
  • Loading branch information
renovate[bot] and sqbot authored Sep 27, 2022
1 parent 61d8b10 commit 42098bb
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 10 deletions.
108 changes: 106 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4437,6 +4437,7 @@ var init_exit_codes = __esm({
ExitCodes = /* @__PURE__ */ ((ExitCodes2) => {
ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS";
ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR";
ExitCodes2[ExitCodes2["NOT_FOUND"] = -2] = "NOT_FOUND";
ExitCodes2[ExitCodes2["UNCLEAN"] = 128] = "UNCLEAN";
return ExitCodes2;
})(ExitCodes || {});
Expand Down Expand Up @@ -5448,9 +5449,22 @@ var init_git_executor_chain = __esm({
return new Promise((done) => {
const stdOut = [];
const stdErr = [];
let rejection;
logger.info(`%s %o`, command, args);
logger("%O", spawnOptions);
let rejection = this._beforeSpawn(task, args);
if (rejection) {
return done({
stdOut,
stdErr,
exitCode: 9901,
rejection
});
}
this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
kill(reason) {
rejection = reason || rejection;
}
}));
const spawned = (0,external_child_process_namespaceObject.spawn)(command, args, spawnOptions);
spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut")));
spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr")));
Expand Down Expand Up @@ -5480,6 +5494,15 @@ var init_git_executor_chain = __esm({
});
});
}
_beforeSpawn(task, args) {
let rejection;
this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
kill(reason) {
rejection = reason || rejection;
}
}));
return rejection;
}
};
}
});
Expand Down Expand Up @@ -6587,6 +6610,59 @@ var init_status = __esm({
}
});

// src/lib/tasks/version.ts
function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) {
return Object.defineProperty({
major,
minor,
patch,
agent,
installed
}, "toString", {
value() {
return `${major}.${minor}.${patch}`;
},
configurable: false,
enumerable: false
});
}
function notInstalledResponse() {
return versionResponse(0, 0, 0, "", false);
}
function version_default() {
return {
version() {
return this._runTask({
commands: ["--version"],
format: "utf-8",
parser(stdOut) {
if (stdOut === NOT_INSTALLED) {
return notInstalledResponse();
}
const version = /version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/.exec(stdOut);
if (!version) {
return versionResponse(0, 0, 0, stdOut);
}
return versionResponse(asNumber(version[1]), asNumber(version[2]), asNumber(version[3]), version[4] || "");
},
onError(result, error, done, fail) {
if (result.exitCode === -2 /* NOT_FOUND */) {
return done(Buffer.from(NOT_INSTALLED));
}
fail(error);
}
});
}
};
}
var NOT_INSTALLED;
var init_version = __esm({
"src/lib/tasks/version.ts"() {
init_utils();
NOT_INSTALLED = "installed=false";
}
});

// src/lib/simple-git-api.ts
var simple_git_api_exports = {};
__export(simple_git_api_exports, {
Expand All @@ -6607,6 +6683,7 @@ var init_simple_git_api = __esm({
init_push();
init_status();
init_task();
init_version();
init_utils();
SimpleGitApi = class {
constructor(_executor) {
Expand Down Expand Up @@ -6670,7 +6747,7 @@ var init_simple_git_api = __esm({
return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
}
};
Object.assign(SimpleGitApi.prototype, commit_default(), config_default(), grep_default(), log_default());
Object.assign(SimpleGitApi.prototype, commit_default(), config_default(), grep_default(), log_default(), version_default());
}
});

Expand Down Expand Up @@ -7680,6 +7757,32 @@ init_config();
init_grep();
init_reset();

// src/lib/plugins/abort-plugin.ts
function abortPlugin(signal) {
if (!signal) {
return;
}
const onSpawnAfter = {
type: "spawn.after",
action(_data, context) {
function kill() {
context.kill(new GitPluginError(void 0, "abort", "Abort signal received"));
}
signal.addEventListener("abort", kill);
context.spawned.on("close", () => signal.removeEventListener("abort", kill));
}
};
const onSpawnBefore = {
type: "spawn.before",
action(_data, context) {
if (signal.aborted) {
context.kill(new GitPluginError(void 0, "abort", "Abort already signaled"));
}
}
};
return [onSpawnBefore, onSpawnAfter];
}

// src/lib/plugins/command-config-prefixing-plugin.ts
init_utils();
function commandConfigPrefixingPlugin(configuration) {
Expand Down Expand Up @@ -7925,6 +8028,7 @@ function gitInstanceFactory(baseDir, options) {
plugins.add(commandConfigPrefixingPlugin(config.config));
}
plugins.add(completionDetectionPlugin(config.completion));
config.abort && plugins.add(abortPlugin(config.abort));
config.progress && plugins.add(progressMonitorPlugin(config.progress));
config.timeout && plugins.add(timeoutPlugin(config.timeout));
config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@actions/core": "1.9.1",
"extract-pr-titles": "1.1.0",
"simple-git": "3.13.0"
"simple-git": "3.14.0"
},
"devDependencies": {
"@vercel/ncc": "0.34.0",
Expand Down

0 comments on commit 42098bb

Please sign in to comment.