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

Commit

Permalink
fix: move platform check from start builder to run-ios builder (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 12, 2020
1 parent 6ffac07 commit 96ffb15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/react-native/src/builders/run-ios/run-ios.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { join } from 'path';
import { getProjectRoot } from '../../utils/get-project-root';
import { fork } from 'child_process';
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
import { platform } from 'os';

export interface ReactNativeRunIOsOptions extends JsonObject {
configuration: string;
Expand All @@ -25,14 +26,17 @@ function run(
options: ReactNativeRunIOsOptions,
context: BuilderContext
): Observable<ReactNativeRunIOsOutput> {
if (platform() !== 'darwin') {
throw new Error(`The run-ios build requires OSX to run`);
}
return from(getProjectRoot(context)).pipe(
tap((root) => ensureNodeModulesSymlink(context.workspaceRoot, root)),
switchMap((root) =>
from(runCliRunIOS(context.workspaceRoot, root, options))
),
map(() => {
return {
success: true
success: true,
};
})
);
Expand Down
3 changes: 0 additions & 3 deletions packages/react-native/src/builders/start/start.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ function run(
options: ReactNativeDevServerOptions,
context: BuilderContext
): Observable<ReactNativeDevServerBuildOutput> {
if (platform() !== 'darwin') {
throw new Error(`The run-ios build requires OSX to run`);
}
return from(getProjectRoot(context)).pipe(
tap((root) => ensureNodeModulesSymlink(context.workspaceRoot, root)),
switchMap((root) =>
Expand Down

0 comments on commit 96ffb15

Please sign in to comment.