auto create nginx temp folder
This commit is contained in:
parent
93ef3c7fea
commit
c099d3f021
|
@ -191,6 +191,11 @@ gulp.task('nginx-stop', ['nginx-conf'], async () => {
|
|||
gulp.task('nginx-conf', async () => {
|
||||
const mustache = require('mustache');
|
||||
|
||||
// crear carpeta nginx &{nginxTemp} si no existe
|
||||
if (!fs.existsSync(nginxTemp)) {
|
||||
fs.mkdirSync(nginxTemp);
|
||||
}
|
||||
|
||||
let params = {
|
||||
services: await getServices(),
|
||||
defaultService: defaultService,
|
||||
|
@ -208,12 +213,12 @@ gulp.task('nginx-conf', async () => {
|
|||
let template = await fs.readFile(confFile, 'utf8');
|
||||
let nginxConf = mustache.render(template, params);
|
||||
|
||||
await fs.writeFile(`${nginxDir}/temp/nginx.conf`, nginxConf);
|
||||
await fs.writeFile(`${nginxTemp}/nginx.conf`, nginxConf);
|
||||
});
|
||||
|
||||
gulp.task('nginx-clean', () => {
|
||||
const del = require('del');
|
||||
return del([`${nginxDir}/temp/*`], {force: true});
|
||||
return del([`${nginxTemp}/*`], {force: true});
|
||||
});
|
||||
|
||||
let services;
|
||||
|
|
Loading…
Reference in New Issue