From ad404b765d4d8594201deec356e86e6da3c6fcd5 Mon Sep 17 00:00:00 2001 From: Ricky Chien Date: Thu, 9 Apr 2015 11:45:44 +0800 Subject: [PATCH] Bug 1102972 - Rebuild if PROFILE_DIR is removed --- build/rebuild.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/rebuild.js b/build/rebuild.js index dd5e278aa824..1dd7a4de1537 100644 --- a/build/rebuild.js +++ b/build/rebuild.js @@ -100,10 +100,12 @@ exports.execute = function(options) { dirChanged(previous[sharedPath] || {}, current[sharedPath], sharedPath); let configChanged = buildConfigChanged(record.build_config, options); + let webappDir = utils.joinPath(options.PROFILE_DIR, 'webapps'); + let webappsExist = utils.fileExists(webappDir); - // Rebuild everything if any BUILD_CONFIG attribute changed or if any - // shared/ file changed - if (configChanged || sharedChanged) { + // Rebuild everything if any BUILD_CONFIG attribute / shared file changed or + // PROFILE_DIR/webapps does not exist + if (configChanged || sharedChanged || !webappsExist) { rebuildAppDirs = scanningDirs; } // Rebuild any app that has any of its source file modified or external app