Skip to content

Commit 72d20d8

Browse files
committed
fix hasLiveReload
1 parent 1d73cd3 commit 72d20d8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Ubiquity/devtools/cmd/Command.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ public static function serve() {
258258
return new Command("serve", "", "Start a web server.", [], [
259259
"h" => Parameter::create("host", "Sets the host ip address.", [], '127.0.0.1'),
260260
"p" => Parameter::create("port", "Sets the listen port number.", [], 8090),
261+
"n" => Parameter::create("nolr", "Starts without live-reload.", [], false),
262+
"l" => Parameter::create("lrport", "Sets the live-reload listen port number.", [], 35729),
261263
"t" => Parameter::create("type", "Sets the server type.", [
262264
'php',
263265
'react',
@@ -273,11 +275,11 @@ public static function serve() {
273275
public static function liveReload() {
274276
return new Command("livereload", "path", "Start the live reload server.", ['live-reload','live'], [
275277
"p" => Parameter::create("port", "Sets the listen port number.", [], 35729),
276-
"i" => Parameter::create("include", "Include file matching pattern .", []),
277-
"e" => Parameter::create("exclude", "Exclude file matching pattern .", [])
278+
"e" => Parameter::create("exts", "Specify extentions to observe .", [],'php,html'),
279+
"x" => Parameter::create("exclusions", "Exclude file matching pattern .", [],'cache/,logs/')
278280
], [
279281
'Starts the live-reload server at 127.0.0.1:35729' => 'Ubiquity live-reload',
280-
'Starts the live-reload server at 127.0.0.1:35800 excluding log files' => 'Ubiquity live-reload -p=35800 -e=logs/*'
282+
'Starts the live-reload server at 127.0.0.1:35800 excluding logs directory' => 'Ubiquity live-reload -p=35800 -x=logs/'
281283
], 'servers');
282284
}
283285

src/Ubiquity/devtools/debug/Debug.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ public static function liveReload(int $port=35729):string{
2323
}
2424

2525
public static function hasLiveReload():bool{
26-
\exec('livereloadx --version', $foo, $exitCode);
27-
return $exitCode === 0;
26+
$exitCode=0;
27+
\exec('livereload --version', $_, $exitCode);
28+
return $exitCode == 1;
2829
}
2930

3031
}

0 commit comments

Comments
 (0)