mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-27 03:13:17 +00:00
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).
This commit is contained in:
parent
81d965f2bd
commit
a45226bfaf
2 changed files with 4 additions and 6 deletions
|
@ -1,12 +1,11 @@
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const { execSync } = require('child_process');
|
const { execFileSync } = require('child_process');
|
||||||
const { sshAgent } = require('./paths.js');
|
const { sshAgent } = require('./paths.js');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Kill the started SSH agent
|
// Kill the started SSH agent
|
||||||
console.log('Stopping SSH agent');
|
console.log('Stopping SSH agent');
|
||||||
execSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
execFileSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error.message);
|
console.log(error.message);
|
||||||
console.log('Error stopping the SSH agent, proceeding anyway');
|
console.log('Error stopping the SSH agent, proceeding anyway');
|
||||||
|
|
5
dist/cleanup.js
vendored
5
dist/cleanup.js
vendored
|
@ -123,14 +123,13 @@ module.exports = require("child_process");
|
||||||
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
||||||
|
|
||||||
const core = __webpack_require__(470);
|
const core = __webpack_require__(470);
|
||||||
const { execSync } = __webpack_require__(129);
|
const { execFileSync } = __webpack_require__(129);
|
||||||
const { sshAgent } = __webpack_require__(972);
|
const { sshAgent } = __webpack_require__(972);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Kill the started SSH agent
|
// Kill the started SSH agent
|
||||||
console.log('Stopping SSH agent');
|
console.log('Stopping SSH agent');
|
||||||
execSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
execFileSync(sshAgent, ['-k'], { stdio: 'inherit' });
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error.message);
|
console.log(error.message);
|
||||||
console.log('Error stopping the SSH agent, proceeding anyway');
|
console.log('Error stopping the SSH agent, proceeding anyway');
|
||||||
|
|
Loading…
Reference in a new issue