Skip to content

Commit

Permalink
Switched --public override from main config to hosting/prepare.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jwngr committed Oct 14, 2015
1 parent 3a3706a commit 98ba539
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/config.js
Expand Up @@ -38,10 +38,6 @@ var Config = function(src, options) {
}
}, this);
}

if (options.public) {
_.set(this.data, 'hosting.public', options.public);
}
};

Config.FILENAME = 'firebase.json';
Expand Down Expand Up @@ -85,6 +81,10 @@ Config.prototype.get = function(key, fallback) {
return _.get(this.data, key, fallback);
};

Config.prototype.set = function(key, value) {
return _.set(this.data, key, value);
};

Config.prototype.has = function(key) {
return _.has(this.data, key);
};
Expand Down
6 changes: 6 additions & 0 deletions lib/deploy/hosting/prepare.js
Expand Up @@ -12,7 +12,13 @@ module.exports = function(context, options, payload) {
};
context.hosting.versionId = context.hosting.versionRef.key();

// Allow the public directory to be overridden by the --public flag
if (options.public) {
options.config.set('hosting.public', options.public);
}

payload.hosting = options.config.get('hosting');

if (!_.has(payload, 'hosting.public')) {
return utils.reject('No public directory specified, can\'t deploy hosting', {exit: 1});
} else if (!fs.existsSync(resolveProjectPath(options.cwd, payload.hosting.public))) {
Expand Down

0 comments on commit 98ba539

Please sign in to comment.