grasscutterTools/packages/create-fast-vue3/utils/getCommand.js
2022-05-02 18:38:10 +08:00

8 lines
278 B
JavaScript

export default function getCommand(packageManager, scriptName) {
if (scriptName === 'install') {
return packageManager === 'yarn' ? 'yarn' : `${packageManager} install`
}
return packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`
}