Skip to content

Commit f740ecc

Browse files
committed
Allow non-interactive manual upgrade
One or both of authoring tool and framework
1 parent a35e1d6 commit f740ecc

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

lib/installHelpers.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ var inputHelpers = {
4141
*/
4242
readline.moveCursor(process.stdout, 0, -1);
4343
return v;
44+
},
45+
isFalsyString: function(v) {
46+
if (typeof v !== 'string') return false;
47+
switch (v.trim()) {
48+
case '':
49+
case 'N':
50+
case 'n':
51+
case 'false':
52+
case 'null':
53+
case 'undefined':
54+
case '0':
55+
return true;
56+
}
4457
}
4558
};
4659

upgrade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function checkForUpdates(callback) {
142142
function doUpdate(data) {
143143
async.series([
144144
function upgradeAuthoring(cb) {
145-
if(!data.adapt_authoring) {
145+
if (installHelpers.inputHelpers.isFalsyString(data.adapt_authoring)) {
146146
return cb();
147147
}
148148
installHelpers.updateAuthoring({
@@ -159,7 +159,7 @@ function doUpdate(data) {
159159
});
160160
},
161161
function upgradeFramework(cb) {
162-
if(!data.adapt_framework) {
162+
if (installHelpers.inputHelpers.isFalsyString(data.adapt_framework)) {
163163
return cb();
164164
}
165165
var dir = path.join(configuration.tempDir, configuration.getConfig('masterTenantID'), OutputConstants.Folders.Framework);

0 commit comments

Comments
 (0)