Files
fressh/packages/react-native-uniffi-russh/scripts/native-build.ts
2025-10-06 23:31:28 -04:00

24 lines
595 B
TypeScript

import * as child from 'child_process';
import * as os from 'os';
const targetOptions = ['ios', 'android'] as const;
type Target = (typeof targetOptions)[number];
const envTarget = process.env.MOBILE_TARGET as Target | undefined;
if (envTarget && !targetOptions.includes(envTarget))
throw new Error(`Invalid target: ${envTarget}`);
const target =
envTarget ??
(() => {
const uname = os.platform();
if (uname === 'darwin') return 'ios';
return 'android';
})();
console.log(`Building for ${target}`);
child.execSync(`turbo run build:${target} --ui stream`, {
stdio: 'inherit',
});