Skip to content

Commit 9506158

Browse files
Merge pull request #269 from technote-space/release/next-v2.0.2
release: v2.0.3
2 parents 31a5e2f + e2f521c commit 9506158

File tree

5 files changed

+230
-237
lines changed

5 files changed

+230
-237
lines changed

__tests__/command2.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('execAsync', () => {
4040
expect(await command.execAsync({command: 'test', cwd: 'dir', altCommand: 'alt'})).toEqual({stdout: 'stdout', stderr: 'stderr', command: 'alt'});
4141

4242
execCalledWith(mockExec, [
43-
['test', [], {'cwd': 'dir', shell: true}],
43+
'test',
4444
]);
4545
stdoutCalledWith(mockStdout, [
4646
'[command]alt',

__tests__/git-helper.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ describe('GitHelper', () => {
287287
]);
288288

289289
execCalledWith(mockExec, [
290-
['command1', [], {cwd: workDir, shell: true}],
291-
['command2', [], {cwd: workDir, shell: true}],
292-
['command3', [], {cwd: workDir, shell: true}],
290+
'command1',
291+
'command2',
292+
'command3',
293293
]);
294294
});
295295

@@ -329,9 +329,9 @@ describe('GitHelper', () => {
329329
]);
330330

331331
execCalledWith(mockExec, [
332-
['command1', [], {cwd: workDir, shell: true}],
333-
['command2', [], {cwd: workDir, shell: true}],
334-
['command3 > /dev/null 2>&1', [], {cwd: workDir, shell: true}],
332+
'command1',
333+
'command2',
334+
'command3 > /dev/null 2>&1',
335335
]);
336336
});
337337

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Helper to filter GitHub Action.",
55
"author": {
66
"name": "Technote",
@@ -34,18 +34,18 @@
3434
"devDependencies": {
3535
"@commitlint/cli": "^8.3.5",
3636
"@commitlint/config-conventional": "^8.3.4",
37-
"@technote-space/github-action-test-helper": "^0.3.2",
37+
"@technote-space/github-action-test-helper": "^0.3.3",
3838
"@types/jest": "^25.1.4",
39-
"@types/node": "^13.9.3",
40-
"@typescript-eslint/eslint-plugin": "^2.25.0",
41-
"@typescript-eslint/parser": "^2.25.0",
39+
"@types/node": "^13.9.5",
40+
"@typescript-eslint/eslint-plugin": "^2.26.0",
41+
"@typescript-eslint/parser": "^2.26.0",
4242
"eslint": "^6.8.0",
4343
"husky": "^4.2.3",
44-
"jest": "^25.2.3",
45-
"jest-circus": "^25.2.3",
46-
"lint-staged": "^10.0.9",
44+
"jest": "^25.2.4",
45+
"jest-circus": "^25.2.4",
46+
"lint-staged": "^10.1.0",
4747
"nock": "^12.0.3",
48-
"ts-jest": "^25.2.1",
48+
"ts-jest": "^25.3.0",
4949
"typescript": "^3.8.3"
5050
},
5151
"publishConfig": {

src/command.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ export default class Command {
125125
cwd?: string,
126126
): Promise<{ stdout: string; stderr: string }> => {
127127
return new Promise((resolve, reject) => {
128-
const process = spawn(command, [], {shell: true, cwd});
129-
let stdout = '';
130-
let stderr = '';
131-
process.stdout.on('data', (data) => {
128+
const subProcess = spawn(command, [], {shell: true, cwd, stdio: [process.stdin, 'pipe', 'pipe']});
129+
let stdout = '';
130+
let stderr = '';
131+
subProcess.stdout.on('data', (data) => {
132132
this.outputStdout(data.toString(), quiet, suppressOutput);
133133
stdout += data.toString();
134134
});
135135

136-
process.stderr.on('data', (data) => {
136+
subProcess.stderr.on('data', (data) => {
137137
this.outputStderr(data.toString(), quiet, suppressOutput, stderrToStdout);
138138
stderr += data.toString();
139139
});
140140

141-
process.on('error', (err) => {
141+
subProcess.on('error', (err) => {
142142
reject(err);
143143
});
144-
process.on('close', () => {
144+
subProcess.on('close', () => {
145145
resolve({stdout, stderr});
146146
});
147147
});

0 commit comments

Comments
 (0)