Skip to content

Commit

Permalink
Use npx in upgrade message if invoked via npx (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson authored Apr 5, 2022
1 parent 896cc11 commit 9573a33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/runLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ async function runLocal(options: Options, pkgData?: Maybe<string>, pkgFile?: May
})
}
else {
print(options, `\nRun ${chalk.cyan('ncu -u')} to upgrade ${getPackageFileName(options)}`)
const ncuCmd = process.env.npm_lifecycle_event === 'npx' ? 'npx npm-check-updates' : 'ncu'
print(options, `\nRun ${chalk.cyan(`${ncuCmd} -u`)} to upgrade ${getPackageFileName(options)}`)
}
}

Expand Down

0 comments on commit 9573a33

Please sign in to comment.