Browse Source

Revert "Create listFile directory if doesn't exist"

This reverts commit 48516a6612.

	modified:   index.js
pull/3/head
Muthu Kumar 7 years ago
parent
commit
183680ac35
  1. 19
      index.js
  2. 5
      utils/listFile.js

19
index.js

@ -14,19 +14,17 @@ var createProxyServer = require('./actions/createProxyServer');
var createStaticServer = require('./actions/createStaticServer');
var killServer = require('./actions/killServer');
var jsonFile;
//appendToList("example.com", "80");
//appendToList("example2.com", "80", "4000");
//appendToList("example2.com", "80", "4444");
console.log(jsonFile);
// Check for requirements such as OS version and nginx install. Throw and exit if requirements not found. #Roadmap: Add ability to satisfy any possible requirements.
requirements(); // Comment in development and uncomment this line in production. This should check whether the OS is compatible with this version of `up`
program
.version('0.1.5')
.arguments('<cmd> [options]')
.action ( function(cmd) {
var cmdValue = cmd;
});
.version('0.1.5');
program
.command('static <domain> [outPort]')
@ -67,9 +65,9 @@ program
});
program
.command('*') // This picks invalid commands, but doesn't pick empty commands, yet.
.command('*') // This should pick invalid commands, but it doesn't, yet.
.action(function () {
console.log("\n Invalid command. Type " + chalk.cyan('up --help') + " for help.\n");
console.log("Invalid command. Type " + chalk.cyan('up --help') + " for help.");
});
// Adds custom help text to the automatically generated help.
@ -86,9 +84,4 @@ program.on('--help', function () {
});
// Parses commands passed to `up` and chooses one of the above commands.
program.parse(process.argv);
if (typeof cmdValue == 'undefined') {
console.log("\nNo commands given. Exiting...\n");
process.exit(1);
}
program.parse(process.argv);

5
utils/listFile.js

@ -4,13 +4,10 @@ var beautifyJSON = require("json-beautify");
var EOL = require('os').EOL; // \n if used on Linux, \r\n if used on Windows.
var listFileDir = "/etc/up-serve/";
var listFilePath = listFileDir + "servers.up";
var listFilePath = "/etc/up-serve/servers.up";
function appendToList(domain, outPort, inPort) {
shell.mkdir('-p', listFileDir);
var jsonFile = {};
var domBlock;

Loading…
Cancel
Save