Skip to content

Commit

Permalink
Adjust pnpm to support Sail alias (#607)
Browse files Browse the repository at this point in the history
* feat: add support for pnpm

* Update npm

* fix: adjust pnpm to support Sail alias

* Update sail

---------

Co-authored-by: Samuel Molendolff Teixeira <[email protected]>
Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
3 people authored Aug 17, 2023
1 parent 4a711be commit cfa1ad5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ function display_help {
echo " ${GREEN}sail npx${NC} Run a npx command"
echo " ${GREEN}sail npm run prod${NC}"
echo
echo "${YELLOW}PNPM Commands:${NC}"
echo " ${GREEN}sail pnpm ...${NC} Run a pnpm command"
echo " ${GREEN}sail pnpx${NC} Run a pnpx command"
echo " ${GREEN}sail pnpm run prod${NC}"
echo
echo "${YELLOW}Yarn Commands:${NC}"
echo " ${GREEN}sail yarn ...${NC} Run a Yarn command"
echo " ${GREEN}sail yarn run prod${NC}"
Expand Down Expand Up @@ -391,6 +396,30 @@ elif [ "$1" == "npx" ]; then
sail_is_not_running
fi

# Proxy PNPM commands to the "pnpm" binary on the application container...
elif [ "$1" == "pnpm" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" pnpm "$@")
else
sail_is_not_running
fi

# Proxy PNPX commands to the "pnpx" binary on the application container...
elif [ "$1" == "pnpx" ]; then
shift 1

if [ "$EXEC" == "yes" ]; then
ARGS+=(exec -u sail)
[ ! -t 0 ] && ARGS+=(-T)
ARGS+=("$APP_SERVICE" pnpx "$@")
else
sail_is_not_running
fi

# Proxy YARN commands to the "yarn" binary on the application container...
elif [ "$1" == "yarn" ]; then
shift 1
Expand Down
2 changes: 1 addition & 1 deletion runtimes/8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apt-get update \
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& curl -fsSL https://get.pnpm.io/install.sh | bash - \
&& npm install -g pnpm \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
Expand Down

0 comments on commit cfa1ad5

Please sign in to comment.