Skip to content

Commit

Permalink
FIX: Installing compiler before run command if not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
mapoart committed Apr 25, 2021
1 parent 81215e2 commit b5b4868
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion nexss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nexssp/cli",
"author": "Marcin Polak [email protected]",
"homepage": "https://nexss.com",
"version": "2.2.39",
"version": "2.2.40",
"description": "Nexss PROGRAMMER - Over 50 programming languages together..",
"main": "nexss.js",
"bin": {
Expand Down

0 comments on commit b5b4868

Please sign in to comment.