Browse Source

Broken kill-all

modified:   actions/createProxyServer.js
	modified:   actions/killALL.js
	modified:   actions/killAllConfirm.js
	modified:   package-lock.json
	modified:   utils/nginxConf.js
pull/8/head
Muthu Kumar 7 years ago
parent
commit
702dd92ebf
  1. 2
      actions/createProxyServer.js
  2. 7
      actions/killALL.js
  3. 7
      actions/killAllConfirm.js
  4. 2
      package-lock.json
  5. 2
      utils/nginxConf.js

2
actions/createProxyServer.js

@ -31,7 +31,7 @@ function createProxyServer(domain, inPort, outPort) {
" }" + EOL +
"}"
);
shell.mkdir('-p', npath.confD());
shell.mkdir('-p', npath.enabledSites());
// Creates directories if doesn't exist
shell.ln('-sf', conf(npath.confD(), domain, outPort),

7
actions/killALL.js

@ -1,6 +1,7 @@
'use strict';
const shell = require('shelljs');
const path = require('path');
const { EOL } = require('os');
@ -17,7 +18,9 @@ function killALL () {
shell.mkdir('-p', npath.confD());
shell.mkdir('-p', npath.enabledSites());
shell.mkdir('-p', npath.webRoot());
shell.cp('./build/defaultNginx.conf', conf(npath.confD()));
console.log(conf(npath.confD()));
shell.cp((path.join(__dirname, '/../build/defaultNginx.conf')),
conf(npath.confD()));
// Create the default.conf file
shell.ln('-sf', npath.confD() + "default.conf",
npath.enabledSites() + "default.conf");
@ -31,7 +34,7 @@ function killALL () {
}
function noKill () {
console.log("\nkill-all was interrupted by user.");
console.log(EOL + "kill-all was interrupted by user.");
}
module.exports.kill = killALL;

7
actions/killAllConfirm.js

@ -1,12 +1,15 @@
'use strict';
const readlineSync = require('readline-sync');
const { EOL } = require('os');
const killALL = require('./killALL').kill;
const { noKill } = require('./killALL');
function killAllConfirm() {
console.log("\nThis action will destroy all nginx servers and return "
+ "to default configuration.");
console.log(EOL + "This action will destroy all nginx servers and return "
+ "to default configuration." + EOL);
if (readlineSync.keyInYN("Are you sure you want to do this?")) {
killALL();
}

2
package-lock.json

@ -1,6 +1,6 @@
{
"name": "up-serve",
"version": "0.1.9",
"version": "0.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

2
utils/nginxConf.js

@ -4,6 +4,8 @@
// concatenates them with ".conf" and returns it.
function conf(path, domain, outPort) {
domain = domain || "";
outPort = outPort || "";
return (path + domain + "." + outPort + ".conf");
}

Loading…
Cancel
Save