chore: 🧹 fix tools

This commit is contained in:
Lucas Colombo
2023-07-03 11:05:24 -03:00
parent 405d6a5855
commit 3bd9cbda12
4 changed files with 24 additions and 10 deletions

View File

@ -11,15 +11,16 @@ const logger = new Logger('deploy', 'info', 'brightMagenta');
const sync = browsersync.create('lugit')
sync.init({
proxy: 'http://lugit.local',
port: 8080,
})
export async function deploy(srcPath, distPath, serverPath, serviceName, file = null) {
export async function deploy(srcPath, distPath, serverPath, serviceName, file = null, live = false) {
logger.info('Deploying...');
if(live && !sync.active) {
sync.init({
proxy: 'http://lugit.local',
port: 8080,
})
}
let shouldRestart = true;
// check if it's an scss
@ -34,7 +35,7 @@ export async function deploy(srcPath, distPath, serverPath, serviceName, file =
await copyTo(distPath, serverPath);
shouldRestart && await restartService(serviceName);
if(!shouldRestart) {
if(!shouldRestart && live) {
sync.reload();
}