1
0

syncCfiles.sh 766 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # script to sync all C files in UserBDOS/ to /C/SRC/ on FPGC
  3. # assumes the subdirectories already exist. In theory a mkdir command could be added
  4. # (mkdir does nothing if the directory already exists)
  5. MAINPATH=$(pwd)
  6. echo $MAINPATH
  7. cd userBDOS
  8. echo "clear" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  9. echo "cd" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  10. echo "clear" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  11. for i in $(find . -type f -print)
  12. do
  13. FNAME=$(basename $i)
  14. DIR=$(dirname $i | cut -c 2-)
  15. echo "sending $DIR/$FNAME"
  16. # move to directory
  17. echo "cd /C/SRC$DIR" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  18. # send file
  19. python3 "$MAINPATH/../Programmer/netUpload.py" "$i" "$FNAME"
  20. done