scripts: Fix flash linux when OUT argument provided (#6133)

Signed-off-by: Ilya Vislotsky <write2ilya@gmail.com>
This commit is contained in:
visilya 2023-04-07 19:32:23 +03:00 committed by GitHub
parent e5ed245ff2
commit 8850084fcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -7,10 +7,17 @@ if [ "$EUID" -ne 0 ]; then
fi fi
set -e set -e
# Setting build output directory
if [ -z "${1}" ]; then
out='out'
else
out=${1}
fi
# Install new micro-controller code # Install new micro-controller code
echo "Installing micro-controller code to /usr/local/bin/" echo "Installing micro-controller code to /usr/local/bin/"
rm -f /usr/local/bin/klipper_mcu rm -f /usr/local/bin/klipper_mcu
cp out/klipper.elf /usr/local/bin/klipper_mcu cp ${out}/klipper.elf /usr/local/bin/klipper_mcu
sync sync
# Restart (if system install script present) # Restart (if system install script present)

View File

@ -11,4 +11,4 @@ CFLAGS_klipper.elf += -lutil -lrt -lpthread
flash: $(OUT)klipper.elf flash: $(OUT)klipper.elf
@echo " Flashing" @echo " Flashing"
$(Q)sudo ./scripts/flash-linux.sh $(Q)sudo ./scripts/flash-linux.sh $(OUT)