Skip to content
This repository was archived by the owner on Feb 25, 2022. It is now read-only.

Commit 96ffb15

Browse files
committed
fix: move platform check from start builder to run-ios builder (closes #8)
1 parent 6ffac07 commit 96ffb15

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/react-native/src/builders/run-ios/run-ios.impl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { join } from 'path';
66
import { getProjectRoot } from '../../utils/get-project-root';
77
import { fork } from 'child_process';
88
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
9+
import { platform } from 'os';
910

1011
export interface ReactNativeRunIOsOptions extends JsonObject {
1112
configuration: string;
@@ -25,14 +26,17 @@ function run(
2526
options: ReactNativeRunIOsOptions,
2627
context: BuilderContext
2728
): Observable<ReactNativeRunIOsOutput> {
29+
if (platform() !== 'darwin') {
30+
throw new Error(`The run-ios build requires OSX to run`);
31+
}
2832
return from(getProjectRoot(context)).pipe(
2933
tap((root) => ensureNodeModulesSymlink(context.workspaceRoot, root)),
3034
switchMap((root) =>
3135
from(runCliRunIOS(context.workspaceRoot, root, options))
3236
),
3337
map(() => {
3438
return {
35-
success: true
39+
success: true,
3640
};
3741
})
3842
);

packages/react-native/src/builders/start/start.impl.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ function run(
2525
options: ReactNativeDevServerOptions,
2626
context: BuilderContext
2727
): Observable<ReactNativeDevServerBuildOutput> {
28-
if (platform() !== 'darwin') {
29-
throw new Error(`The run-ios build requires OSX to run`);
30-
}
3128
return from(getProjectRoot(context)).pipe(
3229
tap((root) => ensureNodeModulesSymlink(context.workspaceRoot, root)),
3330
switchMap((root) =>

0 commit comments

Comments
 (0)