Skip to content

Commit

Permalink
Merge pull request #40 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: v1.9.3
  • Loading branch information
themightychris authored Dec 9, 2024
2 parents 5cb28f4 + 2972a16 commit 606d917
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
release-branch: main
30 changes: 15 additions & 15 deletions lib/Git.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,23 +449,23 @@ class Git {
logger.debug(`${this.command} ${commandArgs.join(' ')}`);

if (execOptions.spawn) {
const process = child_process.spawn(this.command, commandArgs, execOptions);
const gitProcess = child_process.spawn(this.command, commandArgs, execOptions);

if (execOptions.passthrough) {
process.stdout.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => logger.info(line.trimEnd())));
process.stderr.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => logger.error(line.trimEnd())));
gitProcess.stdout.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => logger.info(line.trimEnd())));
gitProcess.stderr.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => logger.error(line.trimEnd())));
} else {
if (execOptions.onStdout) {
process.stdout.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => execOptions.onStdout(line.trimEnd())));
gitProcess.stdout.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => execOptions.onStdout(line.trimEnd())));
}
if (execOptions.onStderr) {
process.stderr.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => execOptions.onStderr(line.trimEnd())));
gitProcess.stderr.on('data', data => data.toString().trimEnd().split(/\n/).forEach(line => execOptions.onStderr(line.trimEnd())));
}
}

if (execOptions.wait) {
return new Promise((resolve, reject) => {
process.on('exit', code => {
gitProcess.on('exit', code => {
if (code == 0) {
resolve();
} else {
Expand All @@ -476,20 +476,20 @@ class Git {
}

let capturePromise;
process.captureOutput = (input = null) => {
gitProcess.captureOutput = (input = null) => {
if (!capturePromise) {
capturePromise = new Promise((resolve, reject) => {
let output = '', error = '';

process.stdout.on('data', data => {
gitProcess.stdout.on('data', data => {
output += data;
});

process.stderr.on('data', data => {
gitProcess.stderr.on('data', data => {
error += data;
});

process.on('close', code => {
gitProcess.on('close', code => {
if (code == 0) {
resolve(output);
} else {
Expand All @@ -504,18 +504,18 @@ class Git {
}

if (input) {
process.stdin.write(input);
process.stdin.end();
gitProcess.stdin.write(input);
gitProcess.stdin.end();
}

return capturePromise;
};

process.captureOutputTrimmed = async (input = null) => {
return (await process.captureOutput(input)).trim();
gitProcess.captureOutputTrimmed = async (input = null) => {
return (await gitProcess.captureOutput(input)).trim();
};

return process;
return gitProcess;
} else if (execOptions.shell) {
return new Promise((resolve, reject) => {
child_process.exec(`${this.command} ${commandArgs.join(' ')}`, execOptions, (error, stdout, stderr) => {
Expand Down

0 comments on commit 606d917

Please sign in to comment.