Skip to content

Commit a45226b

Browse files
authored
Use execFileSync to clean up (#80)
execSync just started a second ssh-agent. `['-k']` argument was treated as options, it didn't have `stdio` set, so stdio was piped and returned (and ignored).
1 parent 81d965f commit a45226b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cleanup.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
const core = require('@actions/core');
2-
const { execSync } = require('child_process');
2+
const { execFileSync } = require('child_process');
33
const { sshAgent } = require('./paths.js');
44

55
try {
66
// Kill the started SSH agent
77
console.log('Stopping SSH agent');
8-
execSync(sshAgent, ['-k'], { stdio: 'inherit' });
9-
8+
execFileSync(sshAgent, ['-k'], { stdio: 'inherit' });
109
} catch (error) {
1110
console.log(error.message);
1211
console.log('Error stopping the SSH agent, proceeding anyway');

dist/cleanup.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,13 @@ module.exports = require("child_process");
123123
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
124124

125125
const core = __webpack_require__(470);
126-
const { execSync } = __webpack_require__(129);
126+
const { execFileSync } = __webpack_require__(129);
127127
const { sshAgent } = __webpack_require__(972);
128128

129129
try {
130130
// Kill the started SSH agent
131131
console.log('Stopping SSH agent');
132-
execSync(sshAgent, ['-k'], { stdio: 'inherit' });
133-
132+
execFileSync(sshAgent, ['-k'], { stdio: 'inherit' });
134133
} catch (error) {
135134
console.log(error.message);
136135
console.log('Error stopping the SSH agent, proceeding anyway');

0 commit comments

Comments
 (0)