From 22637331b00e10c6a0749e155ef613c91c08ad50 Mon Sep 17 00:00:00 2001 From: Matthew Arbesfeld Date: Mon, 18 Aug 2014 15:38:26 -0700 Subject: [PATCH] Document --once and simplify --- packages/autoupdate/autoupdate_cordova.js | 7 +------ tools/commands.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/autoupdate/autoupdate_cordova.js b/packages/autoupdate/autoupdate_cordova.js index 0bfa913971..cb4ebf8bb3 100644 --- a/packages/autoupdate/autoupdate_cordova.js +++ b/packages/autoupdate/autoupdate_cordova.js @@ -152,9 +152,4 @@ Autoupdate._retrySubscription = function () { } }; -// XXX only use Autoupdate if we do not clean the cache. Ideally we have a -// smarter system which only cleans the cache on initial page load, but this -// would require persisting data through location.reload(). -if (! __meteor_runtime_config__.cleanCache) { - Meteor.startup(Autoupdate._retrySubscription); -} +Meteor.startup(Autoupdate._retrySubscription); diff --git a/tools/commands.js b/tools/commands.js index c8fcad9c3f..06a634483c 100644 --- a/tools/commands.js +++ b/tools/commands.js @@ -173,13 +173,16 @@ main.registerCommand({ 'raw-logs': { type: Boolean }, settings: { type: String }, 'no-server': { type: Boolean }, - clean: { type: Boolean}, program: { type: String }, // With --once, meteor does not re-run the project if it crashes // and does not monitor for file changes. Intentionally // undocumented: intended for automated testing (eg, cli-test.sh), // not end-user use. #Once - once: { type: Boolean } + once: { type: Boolean }, + // With --clean, meteor cleans the application directory and uses the + // bundled assets only. Encapsulates the behavior of once (does not rerun) + // and does not monitor for file changes. Not for end-user use. + clean: { type: Boolean} } }, function (options) { @@ -212,6 +215,11 @@ main.registerCommand({ if (options.args.length) { // will asynchronously start mobile emulators/devices try { + // --clean encpasulates the behavior of once + if (options.clean) { + options.once = true; + } + var appName = path.basename(options.appDir); var localPath = path.join(options.appDir, '.meteor', 'local'); cordova.buildPlatforms(localPath, options.args, @@ -936,8 +944,7 @@ main.registerCommand({ options: { settings: { type: String }, port: { type: String, short: "p", default: 'localhost:3000' }, - production: { type: Boolean }, - clean: { type: Boolean} + production: { type: Boolean } } }, function (options) { // XXX replace try-catch with buildmessage.capture