Created
August 24, 2023 02:20
-
-
Save jstm88/f25cffcd0c5a22e564fe8fe20114d3ad to your computer and use it in GitHub Desktop.
Quick shell script to go with prusasend.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
DIR="${HOME}/GCODE" | |
SUB_SUCCESS="uploaded" | |
cd "${DIR}" | |
FILE="$(\ls *.gcode | fzf)" | |
if [[ -f "${FILE}" ]]; then | |
prusasend "${FILE}" | |
retval=$? | |
if [[ $retval == 0 ]]; then | |
echo "Moving file to \"${SUB_SUCCESS}\" directory" | |
mv "${FILE}" "${SUB_SUCCESS}/" | |
fi | |
exit $retval | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment