Skip to content

Commit

Permalink
fixup! fix(cli): invalidate state if pod install was not run
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Sep 4, 2024
1 parent ecf5903 commit 3fc1954
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/build/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function buildAndroid(
): Promise<BuildResult> {
const { sourceDir } = config.project.android ?? {};
if (!sourceDir) {
invalidateState(process.cwd());
invalidateState();
process.exitCode = 1;
logger.fail("No Android project was found");
return Promise.resolve(null);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/build/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function buildIOS(
const { platform } = buildParams;
const { sourceDir, xcodeProject } = config.project[platform] ?? {};
if (!sourceDir || !xcodeProject) {
invalidateState(process.cwd());
invalidateState();
process.exitCode = 1;
const root = platform.substring(0, platform.length - 2);
logger.fail(
Expand All @@ -25,7 +25,7 @@ export function buildIOS(

const { name, path: projectDir } = xcodeProject;
if (!name?.endsWith(".xcworkspace")) {
invalidateState(process.cwd());
invalidateState();
process.exitCode = 1;
logger.fail(
"No Xcode workspaces were found; did you forget to run `pod install`?"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/build/macos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function buildMacOS(
const sourceDir = "macos";
const workspaces = findXcodeWorkspaces(sourceDir);
if (workspaces.length === 0) {
invalidateState(process.cwd());
invalidateState();
process.exitCode = 1;
logger.fail(
"No Xcode workspaces were found; specify an Xcode workspace with `--workspace`"
Expand Down
2 changes: 1 addition & 1 deletion packages/tools-react-native/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function getSavedState(
}

export function invalidateState(
projectRoot: string,
projectRoot = process.cwd(),
/** @internal */ fs = nodefs
) {
fs.rmSync(configCachePath(projectRoot));
Expand Down

0 comments on commit 3fc1954

Please sign in to comment.