syncCsourceFiles.sh 827 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # script to sync all C files in UserBDOS/ to /c/src on FPGC
  3. MAINPATH=$(pwd)
  4. echo $MAINPATH
  5. cd userBDOS
  6. # Go to root directory
  7. echo "clear" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  8. echo "cd /" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  9. # Create directories
  10. echo "mkdir c" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  11. echo "mkdir c/src" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  12. for i in $(find . -type f -print)
  13. do
  14. FNAME=$(basename $i)
  15. DIR="/c/src$(dirname $i | cut -c 2-)"
  16. # Create directory
  17. echo "mkdir $DIR" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  18. # Move to directory
  19. echo "cd $DIR" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  20. # Send file
  21. cd $MAINPATH/../Programmer
  22. sh sendTextFile.sh $MAINPATH/userBDOS/$i
  23. done