Skip to content

Commit cfa1ad5

Browse files
SamuelMTeixeiraSamuel Molendolff Teixeirataylorotwell
authored
Adjust pnpm to support Sail alias (#607)
* feat: add support for pnpm * Update npm * fix: adjust pnpm to support Sail alias * Update sail --------- Co-authored-by: Samuel Molendolff Teixeira <contact@samuelmteixeira.dev> Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 4a711be commit cfa1ad5

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

bin/sail

+29
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ function display_help {
6565
echo " ${GREEN}sail npx${NC} Run a npx command"
6666
echo " ${GREEN}sail npm run prod${NC}"
6767
echo
68+
echo "${YELLOW}PNPM Commands:${NC}"
69+
echo " ${GREEN}sail pnpm ...${NC} Run a pnpm command"
70+
echo " ${GREEN}sail pnpx${NC} Run a pnpx command"
71+
echo " ${GREEN}sail pnpm run prod${NC}"
72+
echo
6873
echo "${YELLOW}Yarn Commands:${NC}"
6974
echo " ${GREEN}sail yarn ...${NC} Run a Yarn command"
7075
echo " ${GREEN}sail yarn run prod${NC}"
@@ -391,6 +396,30 @@ elif [ "$1" == "npx" ]; then
391396
sail_is_not_running
392397
fi
393398

399+
# Proxy PNPM commands to the "pnpm" binary on the application container...
400+
elif [ "$1" == "pnpm" ]; then
401+
shift 1
402+
403+
if [ "$EXEC" == "yes" ]; then
404+
ARGS+=(exec -u sail)
405+
[ ! -t 0 ] && ARGS+=(-T)
406+
ARGS+=("$APP_SERVICE" pnpm "$@")
407+
else
408+
sail_is_not_running
409+
fi
410+
411+
# Proxy PNPX commands to the "pnpx" binary on the application container...
412+
elif [ "$1" == "pnpx" ]; then
413+
shift 1
414+
415+
if [ "$EXEC" == "yes" ]; then
416+
ARGS+=(exec -u sail)
417+
[ ! -t 0 ] && ARGS+=(-T)
418+
ARGS+=("$APP_SERVICE" pnpx "$@")
419+
else
420+
sail_is_not_running
421+
fi
422+
394423
# Proxy YARN commands to the "yarn" binary on the application container...
395424
elif [ "$1" == "yarn" ]; then
396425
shift 1

runtimes/8.2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN apt-get update \
3131
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
3232
&& apt-get install -y nodejs \
3333
&& npm install -g npm \
34-
&& curl -fsSL https://get.pnpm.io/install.sh | bash - \
34+
&& npm install -g pnpm \
3535
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
3636
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
3737
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \

0 commit comments

Comments
 (0)