Skip to content

Instantly share code, notes, and snippets.

@jstm88
Created August 24, 2023 02:20
Show Gist options
  • Save jstm88/f25cffcd0c5a22e564fe8fe20114d3ad to your computer and use it in GitHub Desktop.
Save jstm88/f25cffcd0c5a22e564fe8fe20114d3ad to your computer and use it in GitHub Desktop.
Quick shell script to go with prusasend.py
#!/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