From 4c0fc18470eeb908b194d96db56314eafa503291 Mon Sep 17 00:00:00 2001 From: Markus Padourek Date: Wed, 29 May 2019 10:25:06 +0200 Subject: [PATCH] Simplify setting of process env PATH. --- internal/node/node_loader.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/node/node_loader.js b/internal/node/node_loader.js index 896cca22b2..65a47cebc1 100644 --- a/internal/node/node_loader.js +++ b/internal/node/node_loader.js @@ -27,11 +27,7 @@ var fs = require('fs'); const isWindows = /^win/i.test(process.platform); // Ensure that node is added to the path for any subprocess calls -if (isWindows) { - process.env.PATH = `${path.dirname(process.execPath)};${process.env.PATH}` -} else { - process.env.PATH = `${path.dirname(process.execPath)}:${process.env.PATH}` -} +process.env.PATH = [path.dirname(process.execPath), process.env.PATH].join(isWindows ? ';' : ':'); const DEBUG = false;