Skip to content

Commit

Permalink
add bun to devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
mjleehh committed Dec 23, 2024
1 parent d55b4a1 commit a7ef268
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@ RUN . "$TBD_IDF_ACTIVATE" && pip install \
breathe


#### web app build stage ####

FROM sphinx_docs_stage AS web_app_build_stage

COPY ./tbd-init.sh "$TBD_PATH/"
RUN "$TBD_INIT" install-bun

#### TBD tools ####

# required to build TBD software
FROM sphinx_docs_stage AS tbd_tools_stage
FROM web_app_build_stage AS tbd_tools_stage

RUN . "$TBD_IDF_ACTIVATE" && pip install \
typer \
Expand All @@ -86,7 +93,6 @@ RUN . "$TBD_IDF_ACTIVATE" && pip install \
pyyaml

# setup container shell environment
COPY ./tbd-init.sh "$TBD_PATH/"
ENV PATH="$PATH:$TBD_PATH"
RUN "$TBD_INIT" integrate-idf

Expand Down
15 changes: 12 additions & 3 deletions .devcontainer/tbd-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,22 @@ install_clang() {
fi

if ! curl -o "$clang_installer" "https://apt.llvm.org/llvm.sh"; then
raise "failed to download clang installer"
raise "failed to download clang installer"
fi

if ! chmod +x "$clang_installer"; then
raise "failed to set permissions on clang installer"
raise "failed to set permissions on clang installer"
fi

# install
if ! "$clang_installer" 18 all; then
raise "clang installation failed"
raise "clang installation failed"
fi
}

install_bun() {
if ! curl -fsSL https://bun.sh/install | bash -s "bun-v1.1.4"; then
raise "bun installation failed"
fi
}

Expand Down Expand Up @@ -257,6 +263,9 @@ case $command in
install-clang)
install_clang $command_args
;;
install-bun)
install_bun $command_args
;;
*)
raise "unknown command $command"
;;
Expand Down

0 comments on commit a7ef268

Please sign in to comment.