Permalink
Browse files

feature: Shortcut for watch + serve added

  • Loading branch information...
MikeMitterer committed Apr 17, 2015
1 parent 66d73db commit 7be5a76be1607a0c218c34d49ebf2e60c0a3781a
Showing with 5 additions and 2 deletions.
  1. +2 −2 lib/src/Application.dart
  2. +3 −0 lib/src/Options.dart
View
@@ -48,7 +48,7 @@ class Application {
new Generator().generate(config);
}
if (argResults.wasParsed(Options._ARG_WATCH)) {
if (argResults.wasParsed(Options._ARG_WATCH) || argResults.wasParsed(Options._ARG_WATCH_AND_SERVE)) {
foundOptionToWorkWith = true;
if (_isFolderAvailable(config.contentfolder) && _isFolderAvailable(config.templatefolder)) {
watch(config.contentfolder, config);
@@ -63,7 +63,7 @@ class Application {
watchToRefresh(config.outputfolder, config);
}
if (argResults.wasParsed(Options._ARG_SERVE)) {
if (argResults.wasParsed(Options._ARG_SERVE) || argResults.wasParsed(Options._ARG_WATCH_AND_SERVE)) {
foundOptionToWorkWith = true;
final String port = argResults[Options._ARG_PORT];
serve(config.outputfolder, port);
View
@@ -11,6 +11,7 @@ class Options {
static const _ARG_SERVE = 'serve';
static const _ARG_PORT = 'port';
static const _ARG_WATCH = 'watch';
static const _ARG_WATCH_AND_SERVE = 'watchandserve';
static const _ARG_INIT = 'init';
static const _ARG_USE_SASS = 'usesass';
@@ -53,6 +54,8 @@ class Options {
..addFlag(_ARG_WATCH, abbr: 'w', negatable: false, help: "Observes SRC-dir")
..addFlag(_ARG_WATCH_AND_SERVE, abbr: 'x', negatable: false, help: "Shortcut to watch and serve")
..addFlag(_ARG_INIT, abbr: 'i', negatable: false, help: "Initializes your site\n(not combinable with other options)")
..addFlag(_ARG_SERVE, negatable: false, help: "Serves your site")

0 comments on commit 7be5a76

Please sign in to comment.