Permalink
Browse files

feature: You can now specify where your doc-root is (was by default web)

  • Loading branch information...
MikeMitterer committed May 29, 2015
1 parent 1ca6108 commit a7cae490af8878e35bffdd7a1ad9de65fe87ed57
Showing with 21 additions and 8 deletions.
  1. +7 −7 SiteGen.iml
  2. +1 −1 lib/src/Application.dart
  3. +9 −0 lib/src/Config.dart
  4. +4 −0 lib/src/Options.dart
View
@@ -5,14 +5,14 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_content/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_content/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_data/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_partials/category/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_partials/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_templates/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_content/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_content/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_data/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_partials/category/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_partials/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_templates/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/styles/packages" />
View
@@ -84,7 +84,7 @@ class Application {
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);
serve(config.docroot, port);
}
if (!foundOptionToWorkWith) {
View
@@ -52,6 +52,8 @@ class Config {
_settings[Options._ARG_PORT] = "8080";
_settings[Options._ARG_DOCROOT] = _settings[Config._CONF_OUTPUT_DIR]; // web
_settings[Config._CONF_USE_SASS] = true;
_settings[Config._CONF_USE_AUTOPREFIXER] = true;
@@ -97,6 +99,8 @@ class Config {
String get port => _settings[Options._ARG_PORT];
String get docroot => _settings[Options._ARG_DOCROOT];
bool get usesass => _settings[Config._CONF_USE_SASS];
bool get useautoprefixer => _settings[Config._CONF_USE_AUTOPREFIXER];
@@ -134,6 +138,7 @@ class Config {
settings["Browser"] = browser;
settings["Port"] = port;
settings["Document root"] = docroot;
if(dirstoscan.length > 0) {
settings["Dirs to scan"] = dirstoscan.join(", ");
@@ -184,6 +189,10 @@ class Config {
_settings[Options._ARG_PORT] = _argResults[Options._ARG_PORT];
}
if(_argResults.wasParsed(Options._ARG_DOCROOT)) {
_settings[Options._ARG_DOCROOT] = _argResults[Options._ARG_DOCROOT];
}
if(_argResults.wasParsed(Options._ARG_USE_SASS)) {
_settings[Config._CONF_USE_SASS] = _argResults[Options._ARG_USE_SASS];
}
View
@@ -14,6 +14,7 @@ class Options {
static const _ARG_WATCH = 'watch';
static const _ARG_WATCH_AND_SERVE = 'watchandserve';
static const _ARG_INIT = 'init';
static const _ARG_DOCROOT = 'docroot';
static const _ARG_USE_SASS = 'usesass';
static const _ARG_USE_AUTOPREFIXER = 'useapfx';
@@ -38,6 +39,7 @@ class Options {
print("");
print(" 'Generates all basic files and folders: '$APPNAME -i'");
print(" 'Observes the default dirs and serves the web-folder: '$APPNAME -w --serve'");
print(" 'Observes the default dirs and serves the web-folder: '$APPNAME -x'");
print(" 'Generates the static site in your 'web-folder': '$APPNAME -g'");
print("");
}
@@ -69,6 +71,8 @@ class Options {
..addOption(_ARG_PORT, help: "Sets the port to listen on", defaultsTo: "8000")
..addOption(_ARG_DOCROOT, help: "Document root", defaultsTo: "web")
..addOption(_ARG_LOGLEVEL, abbr: 'v', help: "Sets the appropriate loglevel", allowed: ['info', 'debug', 'warning'])
;

0 comments on commit a7cae49

Please sign in to comment.