🎨 Move opener to the watcher class

This commit is contained in:
brunosimon
2017-12-24 13:18:40 +01:00
parent da39a3065f
commit 034f6910fb
2 changed files with 14 additions and 26 deletions
+13
View File
@@ -3,6 +3,7 @@ const chokidar = require('chokidar')
const fs = require('fs')
const mime = require('mime')
const socketIoClient = require('socket.io-client')
const opener = require('opener')
/**
* Watcher class
@@ -51,6 +52,18 @@ class Watcher
console.log('watcher > socket'.green.bold + ' - ' + 'disconnect'.cyan)
}
})
// Started event
this.socket.on('started', () =>
{
const url = this.config.domain
console.log('app'.green.bold + ' - ' + url.yellow)
if(this.config.open)
{
opener(url)
}
})
}
setExcludeRegex()