Created
June 28, 2024 11:09
-
-
Save s-h-a-d-o-w/d1be4eb4ecad3576af8fa69c248be615 to your computer and use it in GitHub Desktop.
Batch script - "smart" package manager command for JS projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
if exist package-lock.json ( | |
set PM=npm | |
) else if exist yarn.lock ( | |
set PM=yarn | |
) else if exist pnpm-lock.yaml ( | |
set PM=pnpm | |
) else if exist bun.lockb ( | |
set PM=bun | |
) else ( | |
echo No recognized lockfile found. Exiting... | |
exit /b 1 | |
) | |
call %PM% %* | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment