Skip to content

Commit

Permalink
use npx instead of yarn/npm
Browse files Browse the repository at this point in the history
  • Loading branch information
TMisiukiewicz committed Dec 19, 2022
1 parent e772c67 commit 0885f54
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/cli-plugin-metro/src/commands/start/watchMode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import readline from 'readline';
import fs from 'fs';
import {logger, hookStdout} from '@react-native-community/cli-tools';
import execa from 'execa';
import chalk from 'chalk';
Expand Down Expand Up @@ -55,12 +54,10 @@ function enableWatchMode(messageSocket: any) {
messageSocket.broadcast('devMenu', null);
logger.info('Opening developer menu...');
} else if (name === 'i' || name === 'a') {
const isUsingYarn = fs
.readdirSync(`${process.cwd()}`)
.includes('yarn.lock');
logger.info(`Opening the app on ${name === 'i' ? 'iOS' : 'Android'}...`);
execa(isUsingYarn ? 'yarn' : 'npm run', [
name === 'i' ? 'ios' : 'android',
execa('npx', [
'react-native',
name === 'i' ? 'run-ios' : 'run-android',
]).stdout?.pipe(process.stdout);
} else {
console.log(_key);
Expand Down

0 comments on commit 0885f54

Please sign in to comment.