Browse Source

Remove symlinks before adding new.

tags/v0.2.0
Muthu Kumar 7 years ago
parent
commit
800fc3883e
  1. 8
      actions/createStaticServer.js

8
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;
Loading…
Cancel
Save