From b5b486884cfd17db299d77c682517294c55dfc5a Mon Sep 17 00:00:00 2001 From: Marcin Polak Date: Sun, 25 Apr 2021 12:42:37 +0200 Subject: [PATCH] FIX: Installing compiler before run command if not exist. --- nexss.js | 17 ++++++++++++++++- package.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/nexss.js b/nexss.js index 8d375d8..45b0b78 100644 --- a/nexss.js +++ b/nexss.js @@ -430,6 +430,18 @@ if ( process.exit(0); case "run": // TODO: Refactor later for DRY. + + const installCommand = `${ + compiler && compiler.install ? compiler.install : builder.install + }`; + + const command = `${ + compiler && compiler.install ? compiler.command : builder.command + }`; + + const { ensureInstalled } = require("./lib/terminal"); + ensureInstalled(command, installCommand, { verbose: true }); + // Below runs like: // Per compiler run command if not exists main run command else display error that is not specified. const configPath2 = process.env.NEXSS_HOME_PATH + "/config.json"; @@ -495,7 +507,10 @@ if ( function escapeShellArg(arg) { return `"${arg}"`; } - const arguments = `${pmArguments.map(escapeShellArg).join(" ")}`; + const arguments = + process.platform === "win32" + ? `${pmArguments.join(" ")}` + : `${pmArguments.map(escapeShellArg).join(" ")}`; const command = `${runCommand} ${arguments}`; const spawnOptions = require("./config/spawnOptions"); diff --git a/package.json b/package.json index 07314c9..7b8bace 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@nexssp/cli", "author": "Marcin Polak mapoart@gmail.com", "homepage": "https://nexss.com", - "version": "2.2.39", + "version": "2.2.40", "description": "Nexss PROGRAMMER - Over 50 programming languages together..", "main": "nexss.js", "bin": {