User folder name if none provided

This commit is contained in:
brunosimon
2017-12-24 13:34:51 +01:00
parent 0ba869f0eb
commit b6f1e3c43f
3 changed files with 10 additions and 6 deletions
+9 -1
View File
@@ -36,7 +36,15 @@ class Watcher
// Connect event
this.socket.on('connect', () =>
{
this.socket.emit('start_project', { name: this.config.name, path: this.path, excludeRegex: '' + this.excludeRegex })
let name = this.config.name
// If no name, use folder name
if(!name)
{
name = path.parse(this.path).name
}
this.socket.emit('start_project', { name, path: this.path, excludeRegex: '' + this.excludeRegex })
// Debug
if(this.config.debug)