Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): halt update upon failure #3595

Merged
merged 4 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions cli/src/tasks/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,11 @@ export function updateChecks(config: Config, platforms: string[]): CheckFunction
}

export async function update(config: Config, platformName: string, deployment: boolean) {
try {
await runTask(chalk`{green {bold update}} {bold ${platformName}}`, async () => {
if (platformName === config.ios.name) {
await updateIOS(config, deployment);
} else if (platformName === config.android.name) {
await updateAndroid(config);
}
});
} catch (e) {
logError('Error running update:', e);
}
await runTask(chalk`{green {bold update}} {bold ${platformName}}`, async () => {
if (platformName === config.ios.name) {
await updateIOS(config, deployment);
} else if (platformName === config.android.name) {
await updateAndroid(config);
}
});
}
5 changes: 1 addition & 4 deletions cli/test/update.android.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { APP_ID, APP_NAME, CORDOVA_PLUGIN_ID, MappedFS, makeAppDir, makeConfig, run } from './util';
import { updateCommand } from '../src/tasks/update';
import { APP_ID, APP_NAME, CORDOVA_PLUGIN_ID, MappedFS, makeAppDir, run } from './util';

describe.each([false, true])('Update: Android (monoRepoLike: %p)', (monoRepoLike) => {
let appDirObj;
Expand All @@ -14,8 +13,6 @@ describe.each([false, true])('Update: Android (monoRepoLike: %p)', (monoRepoLike
// Init in this directory so we can test add
await run(appDir, `init "${APP_NAME}" "${APP_ID}" --npm-client npm`);
await run(appDir, `add android`);
// Redundant, because add does this, but called explicitly for thoroughness
await updateCommand(makeConfig(appDir), 'android', false);
FS = new MappedFS(appDir);
});

Expand Down
5 changes: 1 addition & 4 deletions cli/test/update.ios.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { APP_ID, APP_NAME, CORDOVA_PLUGIN_ID, MappedFS, makeAppDir, makeConfig, run } from './util';
import { updateCommand } from '../src/tasks/update';
import { APP_ID, APP_NAME, CORDOVA_PLUGIN_ID, MappedFS, makeAppDir, run } from './util';

describe.each([false, true])('Update: iOS (monoRepoLike: %p)', (monoRepoLike) => {
let appDirObj;
Expand All @@ -14,8 +13,6 @@ describe.each([false, true])('Update: iOS (monoRepoLike: %p)', (monoRepoLike) =>
// Init in this directory so we can test add
await run(appDir, `init "${APP_NAME}" "${APP_ID}" --npm-client npm`);
await run(appDir, `add ios`);
// Redundant, because add does this, but called explicitly for thoroughness
await updateCommand(makeConfig(appDir), 'ios', false);
FS = new MappedFS(appDir);
});

Expand Down