Skip to content

Commit

Permalink
fix: handle patch fail error correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
acostalima committed Jan 28, 2021
1 parent 1b2949f commit eddbccf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/create-native-test-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const applyPatches = (loader, nativeTestAppRoot, patches) => {
patches.forEach(({ path: patchFilePath, cwd = nativeTestAppRoot }) => {
patchFilePath = path.resolve(cwd, patchFilePath);

loader.start(`Applying patch to test app: ${patchFilePath}`);
loader.start(`Applying patch ${patchFilePath}`);
try {
execa.sync('git', ['apply', '--ignore-whitespace', patchFilePath], { cwd });
loader.succeed();
} catch (error) {
if (error.message.match(/^error: patch failed:/)) {
if (error.stderr.match(/^error: patch failed:/)) {
loader.warn(`Patch failed: ${patchFilePath}. Proceeding anyway`);
} else {
loader.fail();
Expand Down

0 comments on commit eddbccf

Please sign in to comment.