Skip to content

Commit dc200cd

Browse files
authored
feat: continue with local build instead of prompting (#428)
* feat: continue with local build instead of prompting * changeset
1 parent 9f94154 commit dc200cd

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

.changeset/thin-wombats-relax.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rnef/platform-apple-helpers': patch
3+
'@rnef/platform-android': patch
4+
---
5+
6+
feat: continue with local build instead of prompting

packages/platform-android/src/lib/commands/runAndroid/runAndroid.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
isInteractive,
1414
logger,
1515
outro,
16-
promptConfirm,
1716
promptSelect,
1817
RnefError,
1918
} from '@rnef/tools';
@@ -86,15 +85,14 @@ export async function runAndroid(
8685
binaryPath = cachedBuild.binaryPath;
8786
}
8887
} catch (error) {
89-
logger.warn((error as RnefError).message);
90-
const shouldContinueWithLocalBuild = await promptConfirm({
91-
message: 'Would you like to continue with local build?',
92-
confirmLabel: 'Yes',
93-
cancelLabel: 'No',
94-
});
95-
if (!shouldContinueWithLocalBuild) {
96-
throw new RnefError('Cancelled run');
97-
}
88+
const message = (error as RnefError).message;
89+
const cause = (error as RnefError).cause;
90+
logger.warn(
91+
`Failed to fetch cached build for ${artifactName}: \n${message}`,
92+
cause ? `\nCause: ${cause.toString()}` : ''
93+
);
94+
logger.debug('Remote cache failure error:', error);
95+
logger.info('Continuing with local build');
9896
}
9997
}
10098

packages/platform-apple-helpers/src/lib/commands/run/createRun.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
getLocalBuildCacheBinaryPath,
99
isInteractive,
1010
logger,
11-
promptConfirm,
1211
promptSelect,
1312
RnefError,
1413
saveLocalBuildCache,
@@ -82,15 +81,12 @@ export const createRun = async ({
8281
} catch (error) {
8382
const message = (error as RnefError).message;
8483
const cause = (error as RnefError).cause;
85-
logger.warn(message, cause ? `\nCause: ${cause.toString()}` : '');
86-
const shouldContinueWithLocalBuild = await promptConfirm({
87-
message: 'Would you like to continue with local build?',
88-
confirmLabel: 'Yes',
89-
cancelLabel: 'No',
90-
});
91-
if (!shouldContinueWithLocalBuild) {
92-
throw new RnefError('Cancelled run');
93-
}
84+
logger.warn(
85+
`Failed to fetch cached build for ${artifactName}: \n${message}`,
86+
cause ? `\nCause: ${cause.toString()}` : ''
87+
);
88+
logger.debug('Remote cache failure error:', error);
89+
logger.info('Continuing with local build');
9490
}
9591
}
9692

0 commit comments

Comments
 (0)