From 800fc3883e6dc6947ea015661a9100557e26894e Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Fri, 3 Nov 2017 02:21:06 +0530 Subject: [PATCH] Remove symlinks before adding new. --- actions/createStaticServer.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/actions/createStaticServer.js b/actions/createStaticServer.js index b942476..c86b7cd 100644 --- a/actions/createStaticServer.js +++ b/actions/createStaticServer.js @@ -19,9 +19,11 @@ function createStaticServer(domain, outPort = 80) { " }" + EOL + "}" ) - shell.mkdir('-p', npath.enabledSites()) // Creates directory if doesn't exist - shell.ln('-sf', conf(npath.availableSites(), domain), conf(npath.enabledSites(), domain)) // Symlink the conf file from sites-available to sites-enabled - shell.ln('-sf', ".", npath.webRoot() + domain) // Symlink current directory to nginx's web root + shell.mkdir('-p', npath.enabledSites()); // Creates directory if doesn't exist + shell.rm('-rf', conf(npath.enabledSites(), domain)); + shell.ln('-sf', conf(npath.availableSites(), domain), conf(npath.enabledSites(), domain)); // Symlink the conf file from sites-available to sites-enabled + shell.rm('-rf', npath.webRoot() + domain); + shell.ln('-sf', "./", npath.webRoot() + domain); // Symlink current directory to nginx's web root }; module.exports = createStaticServer; \ No newline at end of file