Skip to content

Commit

Permalink
refactor(snackager): drop npm bin in favor of which yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jul 11, 2024
1 parent fbc18dd commit da2cdb8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions snackager/src/utils/installDependencies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import spawnAsync, { SpawnPromise, SpawnResult } from '@expo/spawn-async';
import path from 'path';

import logger from '../logger';
import { Package } from '../types';
Expand Down Expand Up @@ -39,9 +38,8 @@ export function spawnSafeAsync(
}

export async function getYarnPackagerAsync(): Promise<string> {
const npmBinOutput = await spawnSafeAsync('npm', ['bin']);
const yarn = path.resolve(npmBinOutput.stdout.trim(), 'yarn');
return yarn;
const yarnBinaryPath = await spawnSafeAsync('which', ['yarnpkg']);
return yarnBinaryPath.stdout.trim();
}

async function installDependencyAsync(
Expand Down

0 comments on commit da2cdb8

Please sign in to comment.