@gaiaworks/gaia-cli 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/update.js +13 -2
package/package.json
CHANGED
package/scripts/update.js
CHANGED
|
@@ -168,7 +168,14 @@ function updateCli(args, options = {}) {
|
|
|
168
168
|
setupCommand = path.posix.join(globalPrefix, 'bin', 'gaia');
|
|
169
169
|
setupArgs = ['setup', '--mode', mode];
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
executeChecked(execute, setupCommand, setupArgs, 'restore Gaia CLI mode');
|
|
174
|
+
} catch (error) {
|
|
175
|
+
error.updateInstalled = true;
|
|
176
|
+
error.installedVersion = targetVersion;
|
|
177
|
+
throw error;
|
|
178
|
+
}
|
|
172
179
|
|
|
173
180
|
write(`Update completed: v${targetVersion}`);
|
|
174
181
|
write(`Install mode retained: ${mode}`);
|
|
@@ -179,7 +186,11 @@ if (require.main === module) {
|
|
|
179
186
|
try {
|
|
180
187
|
updateCli(process.argv.slice(2));
|
|
181
188
|
} catch (error) {
|
|
182
|
-
|
|
189
|
+
if (error.updateInstalled) {
|
|
190
|
+
console.error(`[gaia-cli] Gaia CLI v${error.installedVersion} was installed, but post-update setup failed: ${error.message}`);
|
|
191
|
+
} else {
|
|
192
|
+
console.error(`[gaia-cli] Update failed: ${error.message}`);
|
|
193
|
+
}
|
|
183
194
|
process.exit(1);
|
|
184
195
|
}
|
|
185
196
|
}
|