Skip to content

Commit

Permalink
Passing an empty settings file unsets settings on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Naomi Seyfer committed Dec 6, 2012
1 parent ad564f2 commit ad45a08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/meteor/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var bundle_and_deploy = function (options) {
if (set_password) rpcOptions.set_password = set_password;

// When it hits the wire, all these opts will be URL-encoded.
if (settings) rpcOptions.settings = settings;
if (settings !== undefined) rpcOptions.settings = settings;

var tar = child_process.spawn(
'tar', ['czf', '-', 'bundle'], {cwd: build_dir});
Expand Down
11 changes: 8 additions & 3 deletions app/meteor/meteor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ var getSettings = function (filename) {
}
// Ensure that the string is parseable in JSON, but there's
// no reason to use the object value of it yet.
JSON.parse(str);
return str;
if (str.match(/\S/)) {
JSON.parse(str);
return str;
} else {
return "";
}
};

// XXX when the pass unexpected argument or unrecognized flags, print
Expand Down Expand Up @@ -578,8 +582,9 @@ Commands.push({
if (new_argv.delete) {
deploy.delete_app(new_argv._[1]);
} else {
var settings = undefined;
if (new_argv.settings)
var settings = getSettings(new_argv.settings);
settings = getSettings(new_argv.settings);
// accept packages iff we're deploying tests
var project_dir = path.resolve(require_project("bundle", new_argv.tests));
deploy.deploy_app(new_argv._[1], project_dir, new_argv.debug,
Expand Down

0 comments on commit ad45a08

Please sign in to comment.