mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-12 17:55:33 +00:00
34 lines
673 B
JavaScript
34 lines
673 B
JavaScript
#!/usr/bin/env node
|
|
|
|
"use strict";
|
|
|
|
const { exec } = require("child_process");
|
|
const path = require("path");
|
|
const fs = require('fs');
|
|
|
|
let importArgs = []
|
|
|
|
const nm = path.join("./", "node_modules")
|
|
if (fs.existsSync(nm) && fs.lstatSync(nm).isDirectory()) {
|
|
importArgs = ["-m", "node_modules"]
|
|
}
|
|
|
|
const args = [
|
|
"node",
|
|
path.join(__dirname, "aqua-cli-experimental.js"),
|
|
...importArgs,
|
|
...process.argv.slice(2),
|
|
];
|
|
|
|
const argsString = args.join(" ");
|
|
|
|
console.log("Aqua JS: " + argsString);
|
|
exec(argsString, (err, stdout, stderr) => {
|
|
console.error("Aqua JS: " + stderr);
|
|
console.log("Aqua JS: " + stdout);
|
|
|
|
if (err) {
|
|
process.exit(err.code);
|
|
}
|
|
});
|