firecrown/bin/lib/west

42 lines
893 B
Text

function west-update {
local do_venv=$(command -v deactivate >/dev/null; echo $?)
if (( $do_venv > 0 )) activate
pushd "$1"
west update 2>&1 \
| command grep -Ev 'HEAD is now|=== updating|--- zephyr: fetching'
popd
if (( $do_venv > 0 )) deactivate
}
function pip-fmt {
$@ 2>&1 | \
command grep -Ev "Requirement already satisfied|don't match your environment|Using cached"
}
function zephyr-setup {
if [[ ! -d .west ]] \
west init $@
west-update .
pushd zephyr
west zephyr-export >/dev/null
popd
}
function zephyr-sdk {
local version="$1"
local toolchain_base="$base/build"
if [[ ! -d "$toolchain_base" ]] \
mkdir -p "$toolchain_base"
local target_dir="$toolchain_base/zephyr-sdk-$version"
if [[ ! -d "$target_dir" ]]; then
pushd "$app"
west sdk install --version "$version" -d "$target_dir" -t arm-zephyr-eabi
popd
fi
}