Skip to content

Commit 67a5c28

Browse files
authored
fix: Handle iOS scheme with space (#150)
* fix: handle scheme with space * ci: specify node version * ci: try node 16 * fix: test on iPhone 14 * Revert "fix: test on iPhone 14" This reverts commit d5cc3d4. * chore: add changeset
1 parent f706b29 commit 67a5c28

File tree

6 files changed

+38
-1
lines changed

6 files changed

+38
-1
lines changed

.changeset/thick-singers-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-owl': patch
3+
---
4+
5+
Handle iOS scheme with space

.github/workflows/demo-app.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: macos-11
88

99
steps:
10+
- uses: actions/setup-node@v3
11+
with:
12+
node-version: 16
13+
1014
- uses: actions/checkout@v2
1115

1216
- name: Get Runner Information

.github/workflows/demo-expo-app.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
if: ${{ false }}
1111

1212
steps:
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
1317
- uses: actions/checkout@v2
1418

1519
- name: Get Runner Information

.github/workflows/run-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
1317
- uses: actions/checkout@v2
1418

1519
- name: Get yarn cache directory path

lib/cli/build.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ describe('build.ts', () => {
3535
);
3636
});
3737

38+
it('builds an iOS project with scheme with a space in it', async () => {
39+
const config: Config & { ios: { env: ConfigEnv } } = {
40+
ios: {
41+
workspace: 'ios/RNDemo.xcworkspace',
42+
scheme: 'Demo With Space',
43+
configuration: 'Debug',
44+
device: 'iPhone Simulator',
45+
env: { ENTRY_FILE },
46+
},
47+
};
48+
49+
await buildIOS(config, logger);
50+
51+
expect(execMock).toHaveBeenCalledTimes(1);
52+
expect(execMock).toHaveBeenCalledWith(
53+
`xcodebuild -workspace ios/RNDemo.xcworkspace -scheme Demo\\ With\\ Space -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build`,
54+
{ stdio: 'inherit', env: { ENTRY_FILE } }
55+
);
56+
});
57+
3858
it('builds an iOS project with workspace/scheme - with the quiet arg', async () => {
3959
const config: Config & { ios: { env: ConfigEnv } } = {
4060
ios: {

lib/cli/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const buildIOS = async (
1717
: [
1818
`xcodebuild`,
1919
`-workspace ${config.ios?.workspace}`,
20-
`-scheme ${config.ios?.scheme}`,
20+
`-scheme ${config.ios?.scheme?.split(' ').join('\\ ')}`,
2121
`-configuration ${config.ios?.configuration}`,
2222
`-sdk iphonesimulator`,
2323
`-derivedDataPath ios/build`,

0 commit comments

Comments
 (0)