Skip to content

Commit

Permalink
Add reloadOnRestart to cli flag whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Jan 11, 2015
1 parent c8ad54f commit f77fd80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bin/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var logger = require("../lib/logger").logger;
var merge = require("../lib/cli/cli-options").merge;

var cmdWhitelist = ["start", "init"];
var flagWhitelist = ["ghostMode"];
var flagWhitelist = ["ghostMode", "reloadOnRestart"];

var cli = meow({
pkg: "../package.json",
Expand All @@ -26,13 +26,13 @@ handleCli(cli, cmdWhitelist);

/**
* Generate & colour the help text
* @param {String} path - relative file path to the help text
* @param {String} filepath - relative file path to the help text
* @returns {String}
*/
function getHelpText(path) {
function getHelpText(filepath) {
return compile(
fs.readFileSync(
path.resolve(__dirname + path),
path.resolve(__dirname + filepath),
"utf8"
).replace(
"%flags%",
Expand Down Expand Up @@ -83,7 +83,7 @@ function handleCli (cli, cmdWhitelist) {
*/
function verifyOpts (flagWhitelist, cliFlags) {
return Object.keys(cliFlags).every(function (key) {
if (flagWhitelist.indexOf("ghostMode") > -1) {
if (flagWhitelist.indexOf(key) > -1) {
return true;
}
if (!(key in flags)) {
Expand Down
3 changes: 1 addition & 2 deletions lib/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var BrowserSync = function (emitter) {
this.paused = false;
this.config = config;

// Events
this.events = emitter;

this._reloadQueue = [];
Expand Down Expand Up @@ -328,7 +327,7 @@ BrowserSync.prototype.doBrowserReload = function () {
*/
BrowserSync.prototype.doFileReload = function (data) {

var bs = this;
var bs = this;

bs._reloadQueue = bs._reloadQueue || [];
bs._reloadQueue.push(data);
Expand Down

0 comments on commit f77fd80

Please sign in to comment.