← All tips

Bash: run a command only if a file exists

bashscripts

Guard optional steps.

[[ -f pnpm-lock.yaml ]] && echo "locked"