Disable if need be

This commit is contained in:
thosakwe 2017-06-13 23:35:04 -04:00
parent cf0c3c9262
commit 18c06142a9
4 changed files with 16 additions and 2 deletions

View file

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="server.dart" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true" nameIsGenerated="true"> <configuration default="false" name="server.dart" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true" nameIsGenerated="true">
<option name="VMOptions" value="--enable-vm-service" /> <option name="VMOptions" value="--observe" />
<option name="filePath" value="$PROJECT_DIR$/example/basic/server.dart" /> <option name="filePath" value="$PROJECT_DIR$/example/basic/server.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$/example/basic" /> <option name="workingDirectory" value="$PROJECT_DIR$/example/basic" />
<method /> <method />

View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="server.dart (No VM service)" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application" singleton="true">
<option name="filePath" value="$PROJECT_DIR$/example/basic/server.dart" />
<option name="workingDirectory" value="$PROJECT_DIR$/example/basic" />
<method />
</configuration>
</component>

View file

@ -132,6 +132,13 @@ class HotReloader {
} }
_listenToFilesystem() async { _listenToFilesystem() async {
if (!Platform.executableArguments.contains('--observe') &&
!Platform.executableArguments.contains('--enable-vm-service')) {
stderr.writeln(
'WARNING: You have instantiated a HotReloader without passing `--enable-vm-service` or `--observe` to the Dart VM. Hot reloading will be disabled.');
return;
}
for (var path in _paths) { for (var path in _paths) {
if (path is String) { if (path is String) {
await _listenToStat(path); await _listenToStat(path);

View file

@ -1,6 +1,6 @@
name: angel_hot name: angel_hot
description: Supports hot reloading of Angel servers on file changes. description: Supports hot reloading of Angel servers on file changes.
version: 1.0.0 version: 1.0.1
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/hot homepage: https://github.com/angel-dart/hot
environment: environment: