From 7c7ede2f6860fc13625247ceafdc952ad6c5cd29 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Fri, 15 May 2020 13:07:39 +0200 Subject: [PATCH] fix --- asset_jenkins.js | 9 +++++++-- jenkins.js | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/asset_jenkins.js b/asset_jenkins.js index f095939..16d7c07 100644 --- a/asset_jenkins.js +++ b/asset_jenkins.js @@ -5,18 +5,23 @@ * Created by Timo Hocker , May 2020 */ +/* eslint-disable max-len */ 'use strict'; module.exports = `'use strict'; const https = require ('https'); const fs = require ('fs'); -const { fork } = require ('child_process'); +const { execSync: exec_sync } = require ('child_process'); const run_file = fs.createWriteStream ('.jenkins.run.js'); +const [ + ,, ...args +] = process.argv; + run_file.on ('close', () => { - fork ('.jenkins.run.js'); + exec_sync (\`node .jenkins.run.js \${args.join (' ')}\`, { stdio: 'inherit' }); }); https.get ( diff --git a/jenkins.js b/jenkins.js index 077cd9a..865de5a 100644 --- a/jenkins.js +++ b/jenkins.js @@ -2,12 +2,16 @@ const https = require ('https'); const fs = require ('fs'); -const { fork } = require ('child_process'); +const { execSync: exec_sync } = require ('child_process'); const run_file = fs.createWriteStream ('.jenkins.run.js'); +const [ + ,, ...args +] = process.argv; + run_file.on ('close', () => { - fork ('.jenkins.run.js'); + exec_sync (`node .jenkins.run.js ${args.join (' ')}`, { stdio: 'inherit' }); }); https.get (