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
-4
View File
@@ -135,10 +135,6 @@ class App
{ {
config.name = args._[0] config.name = args._[0]
} }
else
{
config.name = 'No name'
}
} }
if(config.host === '') if(config.host === '')
+9 -1
View File
@@ -36,7 +36,15 @@ class Watcher
// Connect event // Connect event
this.socket.on('connect', () => 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 // Debug
if(this.config.debug) if(this.config.debug)
+1 -1
View File
@@ -71,7 +71,7 @@ Arguments list
|---|---| |---|---|
|parameter|`--name`| |parameter|`--name`|
|shortcut|`-n`| |shortcut|`-n`|
|default value|*(string)*`No name`| |default value|*(string)* folder name|
|description|Project name<br>(you can simply add a string after `keppler` keyword like `keppler "My project"`)| |description|Project name<br>(you can simply add a string after `keppler` keyword like `keppler "My project"`)|
||| |||