kaleidoscope-builder: Quote what needs to be quoted

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/305/head
Gergely Nagy 7 years ago
parent ca492e91f6
commit 22636bd768

@ -32,7 +32,7 @@ firmware_size () {
MAX_PROG_SIZE=28672
output="$($@ | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)"
output="$("$@" | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)"
PROGSIZE="$(echo "${output}" | grep "Program:" | cut -d: -f2 | awk '{print $1}')"
@ -86,7 +86,7 @@ flash_over_usb () {
return 1
fi
sleep 1s
${AVRDUDE} -q -q -C ${AVRDUDE_CONF} -p${MCU} -cavr109 -D -P ${DEVICE_PORT_BOOTLOADER} -b57600 "-Uflash:w:${HEX_FILE_PATH}:i"
${AVRDUDE} -q -q -C "${AVRDUDE_CONF}" -p"${MCU}" -cavr109 -D -P "${DEVICE_PORT_BOOTLOADER}" -b57600 "-Uflash:w:${HEX_FILE_PATH}:i"
}
flash_from_bootloader() {
@ -102,8 +102,8 @@ program() {
flash_with_programmer() {
${AVRDUDE} -v \
-C ${AVRDUDE_CONF} \
-p${MCU} \
-C "${AVRDUDE_CONF}" \
-p"${MCU}" \
-cusbtiny \
-D \
-B 1 \
@ -117,7 +117,7 @@ hex_with_bootloader () {
awk '/^:00000001FF/ == 0' "${HEX_FILE_PATH}" > "${HEX_FILE_WITH_BOOTLOADER_PATH}"
echo "Using ${BOOTLOADER_PATH}"
${MD5} ${BOOTLOADER_PATH}
${MD5} "${BOOTLOADER_PATH}"
cat "${BOOTLOADER_PATH}" >> "${HEX_FILE_WITH_BOOTLOADER_PATH}"
ln -sf -- "${HEX_FILE_WITH_BOOTLOADER_PATH}" "${OUTPUT_PATH}/${SKETCH}-latest-with-bootloader.hex"
cat <<- EOF
@ -131,8 +131,8 @@ hex_with_bootloader () {
}
build () {
compile $@
size $@
compile "$@"
size "$@"
}
compile () {
@ -148,7 +148,7 @@ compile () {
fi
ARDUINO_PACKAGES=""
if [ -d ${ARDUINO_PACKAGE_PATH} ]; then
if [ -d "${ARDUINO_PACKAGE_PATH}" ]; then
ARDUINO_PACKAGES="-hardware \"${ARDUINO_PACKAGE_PATH}\""
fi
@ -189,7 +189,7 @@ _find_all () {
for plugin in ./*.ino \
examples/* \
src/*.ino; do
if [ -d "$(dirname ${plugin})" ] || [ -f "${plugin}" ]; then
if [ -d "$(dirname "${plugin}")" ] || [ -f "${plugin}" ]; then
p="$(basename "${plugin}" .ino)"
if [ "${p}" != '*' ]; then
echo "${p}"
@ -204,7 +204,7 @@ build_all () {
for plugin in ${plugins}; do
export SKETCH="${plugin}"
export LIBRARY="${plugin}"
$0 ${plugin} build
$0 "${plugin}" build
done
}
@ -278,11 +278,11 @@ EOF
$DEVICE_PORT is not writable:
`ls -l $DEVICE_PORT`
$(ls -l "$DEVICE_PORT")
You are currently in the following groups:
`id -Gn`
$(id -Gn)
Please ensure you have followed the instructions on setting up your
account to be in the right group:
@ -350,7 +350,7 @@ fi
##
## - if there is only one argument, that's a command
ROOT="$(cd $(dirname $0)/..; pwd)"
ROOT="$(cd "$(dirname "$0")"/..; pwd)"
export ROOT
export SOURCEDIR="$(pwd)"
@ -366,7 +366,7 @@ if [ -e "${SOURCEDIR}/kaleidoscope-builder.conf" ]; then
. "${SOURCEDIR}/kaleidoscope-builder.conf"
fi
. ${ROOT}/etc/kaleidoscope-builder.conf
. "${ROOT}/etc/kaleidoscope-builder.conf"
if [ ! -z "${VERBOSE}" ] && [ "${VERBOSE}" -gt 0 ]; then
ARDUINO_VERBOSE="-verbose"
@ -394,7 +394,7 @@ done
set -- ${cmds}
if [ $# -eq 1 ]; then
cmd="$(echo $1 | tr '-' '_')"
cmd="$(echo "$1" | tr '-' '_')"
${cmd}
exit $?
fi
@ -409,7 +409,7 @@ fi
cmds=""
for i in $(seq 1 $#); do
cmds="${cmds} $(echo $1 | tr '-' '_')"
cmds="${cmds} $(echo "$1" | tr '-' '_')"
shift
done

Loading…
Cancel
Save