syncCsourceFiles.sh 912 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 src" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  11. echo "mkdir src/c" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  12. for i in $(find . -type f -print)
  13. do
  14. FNAME=$(basename $i)
  15. DIR="/src/c$(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. #echo "sync" | python3 "$MAINPATH/../Programmer/sendCommand.py"
  24. #sleep 2
  25. done