Skip to content

Commit

Permalink
fix: attempt to lazy load zx
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jun 22, 2023
1 parent 5070b01 commit ee79c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/createSpawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { type Throttle } from './types';
import chalk from 'chalk';
import randomColor from 'randomcolor';
import { throttle } from 'throttle-debounce';
import { $ } from 'zx';

const log = Logger.child({
namespace: 'createSpawn',
Expand Down Expand Up @@ -69,6 +68,8 @@ export const createSpawn = (
return async (pieces: TemplateStringsArray, ...args: any[]) => {
const binPath = (await findNearestDirectory('node_modules', cwd)) + '/.bin';

const { $ } = await import('zx');

$.cwd = cwd;

$.prefix = `set -euo pipefail; export PATH="${binPath}:$PATH";`;
Expand Down

0 comments on commit ee79c25

Please sign in to comment.