Permalink
Browse files

feature: You can overwrite the port in .sitegen/site.yaml with port: …

…"7000"
  • Loading branch information...
MikeMitterer committed Sep 9, 2016
1 parent cbaa2a0 commit b15fa01604f13bc1e87821425c7af351f466f397
Showing with 8 additions and 6 deletions.
  1. +2 −1 lib/src/Application.dart
  2. +5 −4 lib/src/Config.dart
  3. +1 −1 lib/src/Options.dart
View
@@ -87,7 +87,8 @@ class Application {
if (argResults.wasParsed(Options._ARG_SERVE) || argResults.wasParsed(Options._ARG_WATCH_AND_SERVE)) {
foundOptionToWorkWith = true;
final String port = argResults[Options._ARG_PORT];
final String port = config.port;
serve(config.docroot, port, config.ip);
}
View
@@ -26,6 +26,7 @@ class Config {
static const _CONF_USE_AUTOPREFIXER = 'autoprefixer';
static const _CONF_TALK_TO_ME = 'talktome';
static const _CONF_BROWSER = 'browser';
static const _CONF_PORT = 'port';
static const _CONF_ADDITIONAL_WATCH_FOLDER1 = "watchfolder1";
static const _CONF_ADDITIONAL_WATCH_FOLDER2 = "watchfolder2";
@@ -56,7 +57,7 @@ class Config {
_settings[Config._CONF_SITE_OPTIONS] = {};
_settings[Options._ARG_IP] = "127.0.0.1";
_settings[Options._ARG_PORT] = "8080";
_settings[Config._CONF_PORT] = "8080";
_settings[Options._ARG_DOCROOT] = _settings[Config._CONF_OUTPUT_DIR]; // web
@@ -108,7 +109,7 @@ class Config {
String get ip => _settings[Options._ARG_IP];
String get port => _settings[Options._ARG_PORT];
String get port => _settings[Config._CONF_PORT];
String get docroot => _settings[Options._ARG_DOCROOT];
@@ -203,7 +204,7 @@ class Config {
}
if(_argResults.wasParsed(Options._ARG_PORT)) {
_settings[Options._ARG_PORT] = _argResults[Options._ARG_PORT];
_settings[Config._CONF_PORT] = _argResults[Options._ARG_PORT];
}
if(_argResults.wasParsed(Options._ARG_DOCROOT)) {
@@ -237,7 +238,7 @@ class Config {
_settings.keys.forEach((final String key) {
if(map != null && map.containsKey(key)) {
_settings[key] = map[key];
//print("Found $key in $configfile: ${map[key]}");
print("Found $key in $configfile: ${map[key]}");
}
});
}
View
@@ -75,7 +75,7 @@ class Options {
..addOption(_ARG_IP, help: "Sets the IP-Address to listen on", defaultsTo: "127.0.0.1")
..addOption(_ARG_PORT, help: "Sets the port to listen on", defaultsTo: "8000")
..addOption(_ARG_PORT, help: "Sets the port to listen on")
..addOption(_ARG_DOCROOT, help: "Document root", defaultsTo: "web")

0 comments on commit b15fa01

Please sign in to comment.