From b21164ad3b7edbd9d98b2535deea189dc29d9db0 Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Tue, 31 Oct 2017 16:49:32 +0530 Subject: [PATCH] Added homeDir function to util/nginxPath.js --- actions/createStaticServer.js | 2 +- util/nginxPath.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/actions/createStaticServer.js b/actions/createStaticServer.js index 5567b1a..02fc597 100644 --- a/actions/createStaticServer.js +++ b/actions/createStaticServer.js @@ -21,7 +21,7 @@ function createStaticServer(domain, outPort = 80) { ) shell.mkdir('-p', npath.enabledSites()) shell.ln('-sf', conf(npath.availableSites(), domain), conf(npath.enabledSites(), domain)) - shell.ln('-sf', ".", "/var/www" + domain) + shell.ln('-sf', ".", npath.homeDir() + domain) } module.exports = createStaticServer \ No newline at end of file diff --git a/util/nginxPath.js b/util/nginxPath.js index 6c8f338..38634b5 100644 --- a/util/nginxPath.js +++ b/util/nginxPath.js @@ -1,12 +1,17 @@ function availableSites() { - var availableSites = "/etc/nginx/available-sites/" - return availableSites + var availableSites = "/etc/nginx/available-sites/"; + return availableSites; } function enabledSites() { - var enabledSites = "/etc/nginx/enabled-sites/" - return enabledSites + var enabledSites = "/etc/nginx/enabled-sites/"; + return enabledSites; } -module.exports.availableSites = availableSites -module.exports.enabledSites = enabledSites \ No newline at end of file +function homeDir() { + return "/var/www/"; +} + +module.exports.availableSites = availableSites; +module.exports.enabledSites = enabledSites; +module.exports.homeDir = homeDir; \ No newline at end of file