Skip to content

Commit

Permalink
Add Bun (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
punyflash authored Sep 11, 2023
1 parent 443f696 commit 886bc91
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bin/sail
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ function display_help {
echo " ${GREEN}sail yarn ...${NC} Run a Yarn command"
echo " ${GREEN}sail yarn run prod${NC}"
echo
echo "${YELLOW}Bun Commands:${NC}"
echo " ${GREEN}sail bun ...${NC} Run a bun command"
echo " ${GREEN}sail bunx${NC} Run a bunx command"
echo " ${GREEN}sail bun run prod${NC}"
echo
echo "${YELLOW}Database Commands:${NC}"
echo " ${GREEN}sail mysql${NC} Start a MySQL CLI session within the 'mysql' container"
echo " ${GREEN}sail mariadb${NC} Start a MySQL CLI session within the 'mariadb' container"
Expand Down Expand Up @@ -432,6 +437,30 @@ elif [ "$1" == "yarn" ]; then
sail_is_not_running
fi

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

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

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

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

# Initiate a MySQL CLI terminal session within the "mysql" container...
elif [ "$1" == "mysql" ]; then
shift 1
Expand Down
1 change: 1 addition & 0 deletions runtimes/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN apt-get update \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& curl -fsSL https://bun.sh/install | bash \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.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 /usr/share/keyrings/pgdg.gpg >/dev/null \
Expand Down
1 change: 1 addition & 0 deletions runtimes/8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RUN apt-get update \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& curl -fsSL https://bun.sh/install | bash \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null \
&& echo "deb [signed-by=/usr/share/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 /usr/share/keyrings/pgdg.gpg >/dev/null \
Expand Down
1 change: 1 addition & 0 deletions runtimes/8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN apt-get update \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& npm install -g pnpm \
&& curl -fsSL https://bun.sh/install | bash \
&& 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
1 change: 1 addition & 0 deletions runtimes/8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN apt-get update \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& npm install -g pnpm \
&& curl -fsSL https://bun.sh/install | bash \
&& 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 886bc91

Please sign in to comment.