Skip to content

Commit

Permalink
feature: Shortcut for watch + serve added
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Apr 17, 2015
1 parent 66d73db commit 7be5a76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/Application.dart
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions lib/src/Options.dart
Expand Up @@ -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';
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 7be5a76

Please sign in to comment.