Skip to content

Commit

Permalink
update script to be runnable from any working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrusduong committed Dec 21, 2023
1 parent 8c0a1c5 commit 9a994ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash

# Go to where this shell script resides
cd $(dirname "$0")

rm *.uf2
gh run watch
gh run download -n firmware

# rename the uf2 to be more easy to work with
mv lily58_left-nice_nano_v2-zmk.uf2 left.uf2
mv lily58_right-nice_nano_v2-zmk.uf2 right.uf2

# return to original directory on this shell
cd -
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Escilate this script if it is not sudo
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
return $?
fi

# Define the source files
LEFT_FILE="left.uf2"
RIGHT_FILE="right.uf2"
BASEDIR=$(dirname "$0")
LEFT_FILE="$BASEDIR/left.uf2"
RIGHT_FILE="$BASEDIR/right.uf2"

# Define the destination directory on the USB device
DESTINATION="/mnt/nano" # Change this to the appropriate mount point of your USB device
Expand Down Expand Up @@ -67,5 +68,4 @@ check_and_copy "$LEFT_FILE" "Please connect the left keyboard in device mode"

# Wait for the right keyboard
check_and_copy "$RIGHT_FILE" "Please connect the right keyboard in device mode"

echo "Done!"

0 comments on commit 9a994ce

Please sign in to comment.