From 46d7da99bfbec18d6692a5c3cd02388e7254aab2 Mon Sep 17 00:00:00 2001 From: Reinhard Naegele Date: Mon, 2 Dec 2019 21:22:30 +0100 Subject: [PATCH] Simplify main.js Signed-off-by: Reinhard Naegele --- main.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/main.js b/main.js index ee0628a..d4bef59 100644 --- a/main.js +++ b/main.js @@ -12,19 +12,8 @@ // # See the License for the specific language governing permissions and // limitations under the License. -const spawn = require('child_process').spawn +const spawnSync = require('child_process').spawnSync; const path = require("path"); -const main = async () => { - await new Promise((resolve, reject) => { - const proc = spawn('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'}) - proc.on('close', resolve) - proc.on('error', reject) - }) -} - -main().catch(err => { - console.error(err) - console.error(err.stack) - process.exit(-1) -}) +const proc = spawnSync('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'}); +process.exit(proc.status)