Skip to content

Commit a5b51d6

Browse files
abueideclaude
andcommitted
fix(e2e): use subshells for directory changes
Changed all `cd dir && command && cd ..` patterns to `(cd dir && command)` to ensure commands run in subshells. This prevents the working directory from changing for subsequent commands. The issue was that detox was running from the android directory instead of the project root, causing jest to fail finding e2e/jest.config.js. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3665160 commit a5b51d6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/E2E-compat/devbox.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
"shell": {
2121
"scripts": {
2222
"install": ["yarn install"],
23-
"install:pods": ["cd ios && pod install && cd .."],
23+
"install:pods": ["(cd ios && pod install)"],
2424
"build:android": [
2525
"yarn install",
26-
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .."
26+
"(cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release)"
2727
],
2828
"build:ios": [
2929
"yarn install",
30-
"cd ios && pod install && cd ..",
30+
"(cd ios && pod install)",
3131
"ios.sh xcodebuild -workspace ios/AnalyticsReactNativeE2E.xcworkspace -scheme AnalyticsReactNativeE2E -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
3232
],
3333
"test:e2e:android": [
3434
"yarn install",
35-
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
35+
"(cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release)",
3636
"yarn detox test --configuration android.emu.release"
3737
],
3838
"test:e2e:ios": [
3939
"yarn install",
40-
"cd ios && pod install && cd ..",
40+
"(cd ios && pod install)",
4141
"ios.sh xcodebuild -workspace ios/AnalyticsReactNativeE2E.xcworkspace -scheme AnalyticsReactNativeE2E -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
4242
"yarn detox test --configuration ios.sim.release"
4343
],

examples/E2E-latest/devbox.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
"shell": {
2121
"scripts": {
2222
"install": ["yarn install"],
23-
"install:pods": ["cd ios && pod install && cd .."],
23+
"install:pods": ["(cd ios && pod install)"],
2424
"build:android": [
2525
"yarn install",
26-
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .."
26+
"(cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release)"
2727
],
2828
"build:ios": [
2929
"yarn install",
30-
"cd ios && pod install && cd ..",
30+
"(cd ios && pod install)",
3131
"ios.sh xcodebuild -workspace ios/AnalyticsReactNativeE2E.xcworkspace -scheme AnalyticsReactNativeE2E -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
3232
],
3333
"test:e2e:android": [
3434
"yarn install",
35-
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
35+
"(cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release)",
3636
"yarn detox test --configuration android.emu.release"
3737
],
3838
"test:e2e:ios": [
3939
"yarn install",
40-
"cd ios && pod install && cd ..",
40+
"(cd ios && pod install)",
4141
"ios.sh xcodebuild -workspace ios/AnalyticsReactNativeE2E.xcworkspace -scheme AnalyticsReactNativeE2E -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
4242
"yarn detox test --configuration ios.sim.release"
4343
],

0 commit comments

Comments
 (0)