Skip to content

Commit

Permalink
fix recursive script
Browse files Browse the repository at this point in the history
  • Loading branch information
MP281X committed Jun 24, 2024
1 parent 20a4fce commit dcda4ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { args, cmd } = getArgs()

switch (cmd) {
case '--recursive': {
await nodeExec(['--reporter=ndjson', `--recursive=${args.join(' ')}`])
await execCmd('x', ['pnpm', '--reporter=ndjson', '--recursive', 'run', ...args], 'inherit')

break
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { packageManager } from './projectData.ts'

export const execCmd = async (cmd: string, args: readonly string[], stdio: 'pipe' | 'inherit' = 'pipe') => {
const cmdName = cmd.split('/').pop()?.split('.').shift()
printLog(`${cmdName} ${args.join(' ')}\n`, 'warn')
if (cmd !== 'x') printLog(`${cmdName} ${args.join(' ')}\n`, 'warn')

const execPromise = new Promise<void>((resolve, _) => {
const output = spawn(cmd, args, {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const formatLog = (input: string, type: LogType, prefix?: string) => {
}
}

export const printLog = (txt: string, type: LogType, prefix = '\n') => {
export const printLog = (txt: string, type: LogType, prefix = '') => {
// biome-ignore format:
switch (type) {
case 'info': return console.log(prefix + txt)
Expand Down

0 comments on commit dcda4ee

Please sign in to comment.