From f1764260c3a3fe63e406baecf0cee7f558c9e433 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:41:41 +0000 Subject: [PATCH 01/10] adding stderr --- dist/index.js | 3 +++ src/git-command-manager.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index 307d9fd..cbd67f0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7403,6 +7403,9 @@ class GitCommandManager { const listeners = { stderr: (data) => { stderr.push(data.toString()); + }, + errline: (line) => { + stderr.push(line); } }; const output = yield this.execGit(args, false, false, listeners); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index afcb285..39075a7 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -108,6 +108,9 @@ class GitCommandManager { const listeners = { stderr: (data: Buffer) => { stderr.push(data.toString()) + }, + errline: (line: string) => { + stderr.push(line) } } const output = await this.execGit(args, false, false, listeners) From 9679ac6b686c701fa8c1050e57fd9ee7097009ad Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:42:30 +0000 Subject: [PATCH 02/10] adding stderr --- src/git-command-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 39075a7..95004f2 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -127,7 +127,7 @@ class GitCommandManager { result.push(branch) } } - core.debug(stderr.join('\n')) + core.info(stderr.join('\n')) return result } From 1f9aeb9f74defe2baa514759308d8de8b14f1f12 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 30 Nov 2022 20:45:33 +0000 Subject: [PATCH 03/10] adding stderr --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index cbd67f0..6a5dea2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7421,7 +7421,7 @@ class GitCommandManager { result.push(branch); } } - core.debug(stderr.join('\n')); + core.info(stderr.join('\n')); return result; }); } From bac1bcfa81e7990871a7b944594f6a3832c36fc3 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:20:32 +0000 Subject: [PATCH 04/10] . --- dist/index.js | 14 +++++++++++++- package-lock.json | 13 +++++++++++++ package.json | 1 + src/git-command-manager.ts | 11 ++++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6a5dea2..f8fc0c4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,6 +7333,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7344,6 +7347,7 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); +const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7692,15 +7696,23 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; + let temp = ''; const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD + listeners: listenersD, + errStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp += chunk.toString(); + next(); + } + }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); + core.info(temp.length.toString()); return result; }); } diff --git a/package-lock.json b/package-lock.json index 2870934..4022862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5906,6 +5906,11 @@ "integrity": "sha512-qcLvDUPf8DSIMWarHT2ptgcqrYg62n3vPA7vhrOF24d8UNzbUBaHu2CySiENR3nEDzYgaN60071t0F6KLYMQ7Q==", "dev": true }, + "emitter-component": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.1.1.tgz", + "integrity": "sha512-G+mpdiAySMuB7kesVRLuyvYRqDmshB7ReKEVuyBPkzQlmiDiLrt7hHHIy4Aff552bgknVN7B2/d3lzhGO5dvpQ==" + }, "emittery": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", @@ -16487,6 +16492,14 @@ } } }, + "stream": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz", + "integrity": "sha512-gCq3NDI2P35B2n6t76YJuOp7d6cN/C7Rt0577l91wllh0sY9ZBuw9KaSGqH/b0hzn3CWWJbpbW0W0WvQ1H/Q7g==", + "requires": { + "emitter-component": "^1.1.1" + } + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", diff --git a/package.json b/package.json index d305679..316aefe 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@actions/github": "^2.2.0", "@actions/io": "^1.0.1", "@actions/tool-cache": "^1.1.2", + "stream": "0.0.2", "uuid": "^3.3.3" }, "devDependencies": { diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 95004f2..2cac95d 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -7,6 +7,7 @@ import * as refHelper from './ref-helper' import * as regexpHelper from './regexp-helper' import * as retryHelper from './retry-helper' import {GitVersion} from './git-version' +import stream, {Writable} from 'stream' // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 @@ -428,16 +429,24 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] + let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD + listeners: listenersD, + errStream: new stream.Writable({ + write(chunk, _, next) { + temp += chunk.toString() + next() + } + }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') + core.info(temp.length.toString()) return result } From 25424e8595832e5920397a67f42204c13dbd97f8 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:41:55 +0000 Subject: [PATCH 05/10] . --- src/git-command-manager.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 2cac95d..0fc0aed 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -430,6 +430,7 @@ class GitCommandManager { const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] let temp = '' + let temp2 = '' const options = { cwd: this.workingDirectory, env, @@ -441,12 +442,20 @@ class GitCommandManager { temp += chunk.toString() next() } + }), + + outStream: new stream.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString() + next() + } }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') core.info(temp.length.toString()) + core.info(temp2.length.toString()) return result } From d2e9d8b595dda75742c2a742ff92f7f4bce64db9 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:42:14 +0000 Subject: [PATCH 06/10] . --- dist/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dist/index.js b/dist/index.js index f8fc0c4..4945647 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7697,6 +7697,7 @@ class GitCommandManager { const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; let temp = ''; + let temp2 = ''; const options = { cwd: this.workingDirectory, env, @@ -7708,11 +7709,18 @@ class GitCommandManager { temp += chunk.toString(); next(); } + }), + outStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString(); + next(); + } }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); core.info(temp.length.toString()); + core.info(temp2.length.toString()); return result; }); } From a9f581070eeb8e1555eb74772a0ccd21980b24a2 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:45:10 +0000 Subject: [PATCH 07/10] . --- dist/index.js | 31 ++++++++++--------------------- src/git-command-manager.ts | 28 ++++++++++------------------ 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4945647..f7b14bc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,9 +7333,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7347,7 +7344,6 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); -const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7696,31 +7692,24 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - let temp = ''; - let temp2 = ''; + // let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp += chunk.toString(); - next(); - } - }), - outStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString(); - next(); - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(temp.length.toString()); - core.info(temp2.length.toString()); + core.info(result.stdout); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 0fc0aed..2a0b588 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -429,33 +429,25 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - let temp = '' - let temp2 = '' + // let temp = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream.Writable({ - write(chunk, _, next) { - temp += chunk.toString() - next() - } - }), - - outStream: new stream.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString() - next() - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(temp.length.toString()) - core.info(temp2.length.toString()) + core.info(result.stdout) return result } From b99f9d0abab65214fe4f1812f7d2cd23f281460e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:52:47 +0000 Subject: [PATCH 08/10] . --- dist/index.js | 1 + src/git-command-manager.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/dist/index.js b/dist/index.js index f7b14bc..54cd2c4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7389,6 +7389,7 @@ class GitCommandManager { return __awaiter(this, void 0, void 0, function* () { const result = []; const stderr = []; + core.info(this.gitEnv['GIT_HTTP_USER_AGENT']); // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 2a0b588..4c86e65 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -94,6 +94,7 @@ class GitCommandManager { const result: string[] = [] const stderr: string[] = [] + core.info(this.gitEnv['GIT_HTTP_USER_AGENT']) // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug From 8e555ec39e30b1ef6df1fc9e1a628b867115deba Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 15:56:41 +0000 Subject: [PATCH 09/10] . --- dist/index.js | 32 +++++++++++++++++++++----------- src/git-command-manager.ts | 29 ++++++++++++++++++----------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/dist/index.js b/dist/index.js index 54cd2c4..4945647 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,6 +7333,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7344,6 +7347,7 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); +const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7389,7 +7393,6 @@ class GitCommandManager { return __awaiter(this, void 0, void 0, function* () { const result = []; const stderr = []; - core.info(this.gitEnv['GIT_HTTP_USER_AGENT']); // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug @@ -7693,24 +7696,31 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - // let temp = '' + let temp = ''; + let temp2 = ''; const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD - // , - // errStream: new stream.Writable({ - // write(chunk, _, next) { - // temp += chunk.toString() - // next() - // } - // }) + listeners: listenersD, + errStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp += chunk.toString(); + next(); + } + }), + outStream: new stream_1.default.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString(); + next(); + } + }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(result.stdout); + core.info(temp.length.toString()); + core.info(temp2.length.toString()); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 4c86e65..0fc0aed 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -94,7 +94,6 @@ class GitCommandManager { const result: string[] = [] const stderr: string[] = [] - core.info(this.gitEnv['GIT_HTTP_USER_AGENT']) // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from // "branch --list" is more difficult when in a detached HEAD state. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug @@ -430,25 +429,33 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - // let temp = '' + let temp = '' + let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD - // , - // errStream: new stream.Writable({ - // write(chunk, _, next) { - // temp += chunk.toString() - // next() - // } - // }) + listeners: listenersD, + errStream: new stream.Writable({ + write(chunk, _, next) { + temp += chunk.toString() + next() + } + }), + + outStream: new stream.Writable({ + write(chunk, _, next) { + temp2 += chunk.toString() + next() + } + }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(result.stdout) + core.info(temp.length.toString()) + core.info(temp2.length.toString()) return result } From af5130cb8882054eda385840657dcbd1e19ab8f4 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 1 Dec 2022 18:37:34 +0000 Subject: [PATCH 10/10] . --- dist/index.js | 40 ++++++++++++++++++-------------------- src/git-command-manager.ts | 36 ++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4945647..9c56430 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7333,9 +7333,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCommandManager = exports.MinimumGitVersion = void 0; const core = __importStar(__webpack_require__(470)); @@ -7347,7 +7344,6 @@ const refHelper = __importStar(__webpack_require__(227)); const regexpHelper = __importStar(__webpack_require__(528)); const retryHelper = __importStar(__webpack_require__(587)); const git_version_1 = __webpack_require__(559); -const stream_1 = __importDefault(__webpack_require__(794)); // Auth header not supported before 2.9 // Wire protocol v2 not supported before 2.18 exports.MinimumGitVersion = new git_version_1.GitVersion('2.18'); @@ -7696,31 +7692,33 @@ class GitCommandManager { // }} const listenersD = Object.assign(Object.assign({}, customListeners), defaultListener); const stdout = []; - let temp = ''; - let temp2 = ''; + // let temp = '' + // let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp += chunk.toString(); - next(); - } - }), - outStream: new stream_1.default.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString(); - next(); - } - }) + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }), + // outStream: new stream.Writable({ + // write(chunk, _, next) { + // temp2 += chunk.toString() + // next() + // } + // }) }; result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options); result.stdout = stdout.join(''); - core.info(temp.length.toString()); - core.info(temp2.length.toString()); + // core.info(temp.length.toString()) + // core.info(temp2.length.toString()) + core.info(result.stdout); return result; }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 0fc0aed..2c67ef5 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -429,33 +429,35 @@ class GitCommandManager { // }} const listenersD = {...customListeners, ...defaultListener} const stdout: string[] = [] - let temp = '' - let temp2 = '' + // let temp = '' + // let temp2 = '' const options = { cwd: this.workingDirectory, env, silent, ignoreReturnCode: allowAllExitCodes, - listeners: listenersD, - errStream: new stream.Writable({ - write(chunk, _, next) { - temp += chunk.toString() - next() - } - }), + listeners: listenersD + // , + // errStream: new stream.Writable({ + // write(chunk, _, next) { + // temp += chunk.toString() + // next() + // } + // }), - outStream: new stream.Writable({ - write(chunk, _, next) { - temp2 += chunk.toString() - next() - } - }) + // outStream: new stream.Writable({ + // write(chunk, _, next) { + // temp2 += chunk.toString() + // next() + // } + // }) } result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options) result.stdout = stdout.join('') - core.info(temp.length.toString()) - core.info(temp2.length.toString()) + // core.info(temp.length.toString()) + // core.info(temp2.length.toString()) + core.info(result.stdout) return result }