Skip to content

Instantly share code, notes, and snippets.

@f
Created November 15, 2022 17:38
Show Gist options
  • Save f/738d519dc969117e942666c8ddba3a96 to your computer and use it in GitHub Desktop.
Save f/738d519dc969117e942666c8ddba3a96 to your computer and use it in GitHub Desktop.
# add this to bashrc
p() {
if [ -f "yarn.lock" ]; then
yarn $1
fi
if [ -f "package-lock.json" ]; then
npm run $1
fi
}
@ademilter
Copy link

p() {
  if [ -f "yarn.lock" ]; then
    yarn $1
  elif [ -f "pnpm-lock.yaml" ]; then
    pnpm $1
  else
    npm $1
  fi
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment