Skip to content

Fix some whitespace quoting errors #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ fail() {

R="${?}"
echo "Validation failed! :'-("
if [ ${*} ]; then
if [[ ${#} -ne 1 ]]; then
echo "${*}"
fi
exit ${R}
}

validate_git_repo() {
# tests that the given relative path exists and is a git repo
git -C ${TARGET_DIR}/${1} status >& /dev/null || fail
git -C "${TARGET_DIR}/${1}" status >& /dev/null || fail
}

validate_toolchain_linux() {
Expand Down Expand Up @@ -215,7 +215,7 @@ clone_raspberrypi_repo() {
else
echo "Cloning ${REPO_URL}"
if [ ${#} -gt 0 ]; then
git -C "${TARGET_DIR}" clone -b "${BRANCH}" "${REPO_URL}" ${*}
git -C "${TARGET_DIR}" clone -b "${BRANCH}" "${REPO_URL}" "${@}"
else
git -C "${TARGET_DIR}" clone -b "${BRANCH}" "${REPO_URL}"
fi
Expand Down Expand Up @@ -365,13 +365,13 @@ validate_pico_examples() {
validate_git_repo pico-examples

# test that blink is built
test -f ${TARGET_DIR}/pico-examples/build/blink/blink.uf2 || fail
test -f "${TARGET_DIR}/pico-examples/build/blink/blink.uf2" || fail

# test that hello_serial is built
test -f ${TARGET_DIR}/pico-examples/build/hello_world/serial/hello_serial.uf2 || fail
test -f "${TARGET_DIR}/pico-examples/build/hello_world/serial/hello_serial.uf2" || fail

# test that hello_usb is built
test -f ${TARGET_DIR}/pico-examples/build/hello_world/usb/hello_usb.uf2 || fail
test -f "${TARGET_DIR}/pico-examples/build/hello_world/usb/hello_usb.uf2" || fail
}

validate_pico_playground() {
Expand All @@ -397,7 +397,7 @@ validate_picotool() {
validate_git_repo picotool

# test that the binary is built
test -x ${TARGET_DIR}/picotool/build/picotool || fail
test -x "${TARGET_DIR}"/picotool/build/picotool || fail

# test that picotool is installed in the expected location
test -x /usr/local/bin/picotool || fail
Expand Down Expand Up @@ -428,7 +428,7 @@ validate_openocd() {
validate_git_repo openocd

# test that the binary is built
test -x ${TARGET_DIR}/openocd/src/openocd || fail
test -x "${TARGET_DIR}"/openocd/src/openocd || fail
}

setup_openocd() {
Expand Down Expand Up @@ -458,7 +458,7 @@ validate_picoprobe() {
validate_git_repo picoprobe || fail

# test that the binary is built
test -f ${TARGET_DIR}/picoprobe/build/picoprobe.uf2 || fail
test -f "${TARGET_DIR}"/picoprobe/build/picoprobe.uf2 || fail
}

setup_picoprobe() {
Expand Down