Skip to content

Commit

Permalink
[script] allow passing in toolchain_dir as an arg for `install_arm_…
Browse files Browse the repository at this point in the history
…toolchain()`
  • Loading branch information
lmnotran committed Jun 21, 2024
1 parent 1948f71 commit b14c678
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ install_arm_toolchain()
{
local url=${1-"https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz"}
local extract_dir=${2-"arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi"}

local toolchain_dir
# Link if root
if [ "$EUID" -eq 0 ]; then
toolchain_dir=/opt
else
toolchain_dir="${HOME}/.local"
local toolchain_dir=${3-""}

# If toolchain_dir is not provided, use /opt if root, else use ~/.local
if [ -z "${toolchain_dir}" ]; then
if [ "$EUID" -eq 0 ]; then
toolchain_dir=/opt
else
toolchain_dir="${HOME}/.local"
fi
fi

# Check if the toolchain is already present at the desired location
Expand Down

0 comments on commit b14c678

Please sign in to comment.