From fae6d5410dcbbde62f0e3b486c321c9056dba51d Mon Sep 17 00:00:00 2001 From: Maciej Pasternacki Date: Fri, 11 Jun 2021 14:21:18 +0200 Subject: [PATCH] Use execFileSync to clean up 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). --- cleanup.js | 5 ++--- dist/cleanup.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cleanup.js b/cleanup.js index 529fbe8..34b2bbc 100644 --- a/cleanup.js +++ b/cleanup.js @@ -1,12 +1,11 @@ const core = require('@actions/core'); -const { execSync } = require('child_process'); +const { execFileSync } = require('child_process'); const { sshAgent } = require('./paths.js'); try { // Kill the started SSH agent console.log('Stopping SSH agent'); - execSync(sshAgent, ['-k'], { stdio: 'inherit' }); - + execFileSync(sshAgent, ['-k'], { stdio: 'inherit' }); } catch (error) { console.log(error.message); console.log('Error stopping the SSH agent, proceeding anyway'); diff --git a/dist/cleanup.js b/dist/cleanup.js index 49024b4..38a3d56 100644 --- a/dist/cleanup.js +++ b/dist/cleanup.js @@ -123,14 +123,13 @@ module.exports = require("child_process"); /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { const core = __webpack_require__(470); -const { execSync } = __webpack_require__(129); +const { execFileSync } = __webpack_require__(129); const { sshAgent } = __webpack_require__(972); try { // Kill the started SSH agent console.log('Stopping SSH agent'); - execSync(sshAgent, ['-k'], { stdio: 'inherit' }); - + execFileSync(sshAgent, ['-k'], { stdio: 'inherit' }); } catch (error) { console.log(error.message); console.log('Error stopping the SSH agent, proceeding anyway');