From aec0684e4cd93b64770001c369b6829c1d15ac8f Mon Sep 17 00:00:00 2001 From: Marcin Polak Date: Tue, 27 Apr 2021 14:14:00 +0200 Subject: [PATCH] removed -bg function. Will be provided in 2.3.0+ --- lib/core/-bg.js | 50 ------------------------------------------------- lib/core/-bg.md | 13 ------------- package.json | 2 +- 3 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 lib/core/-bg.js delete mode 100644 lib/core/-bg.md diff --git a/lib/core/-bg.js b/lib/core/-bg.js deleted file mode 100644 index 37180db..0000000 --- a/lib/core/-bg.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports.x = () => { - const { bold } = require("@nexssp/ansi"); - const { nohup } = require("../nohup.js"); - const { title } = require("../../lib/proc"); - let argv = process.argv.slice(3); - const command = "nexss " + argv.join(" "); - process.title = title(); - log.ok("Execute in the background: " + bold(command)); - nohup(command); -}; - -module.exports = () => { - const { title } = require("../../lib/proc"); - const { spawn } = require("child_process"); - const out = fs.openSync("./out.log", "a"); - const err = fs.openSync("./out.log", "a"); - - let argv = process.argv.slice(3); - // const command = "nexss " + argv.join(" "); - - process.title = title(); - const opts = { - detached: true, - stdio: ["ignore", out, err], - }; - - opts.shell = process.shell; - - if (!process.argv.includes("--nxsWindow")) { - opts.windowsHide = true; - } else { - process.argv.filter((e) => e !== "--nxsWindow"); - } - - const command = process.argv.shift(); - const arguments = process.argv.filter((e) => e !== "--bg"); - const subprocess = spawn(command, arguments, opts); - - log.ok("Execute in the background: " + command + " " + bold(argv.join(" "))); - subprocess.unref(); - - if (typeof subprocess.pid !== "undefined") { - fs.writeFileSync(".server.pid", subprocess.pid, { - encoding: "utf8", - }); - log.ok("Detached."); - } else { - log.error("Failed."); - } -}; diff --git a/lib/core/-bg.md b/lib/core/-bg.md deleted file mode 100644 index 9c57070..0000000 --- a/lib/core/-bg.md +++ /dev/null @@ -1,13 +0,0 @@ -# nexss -bg - -Starts nexss in the background. - -```sh -nexss -bg index.js -nexss -bg myprogram.r - -nexss -bg Select/Dropper --_color=11ff55 --_x=100 \ ---_width=220 --_height=150 --_text="Action 1" --nxsExecute="nexss action1.nexss" - - -``` diff --git a/package.json b/package.json index 06a038e..128b858 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.48", + "version": "2.2.49", "description": "Nexss PROGRAMMER - Over 50 programming languages together..", "main": "nexss.js", "bin": {