A fork of RinRi's CPSRC. A tool for C++ Competitive programmers to do stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. echo "Your distro? ( 1)Arch, 2)Debian): "
  2. read distro
  3. if [ $distro -eq 1 ]
  4. then
  5. sudo pacman -Syu g++ code
  6. elif [ $distro -eq 2 ]
  7. then
  8. sudo apt update
  9. sudo apt upgrade
  10. sudo apt install g++ code
  11. else
  12. echo "Please install these packages manually: Code, G++"
  13. read -p "Press enter to continue" A
  14. fi
  15. read -r -p "${1:-Set custom directory for code? [y/N]} " response
  16. case "$response" in
  17. [yY][eE][sS]|[yY])
  18. echo "Enter directory for files:"
  19. read DIR
  20. echo "set dir as $DIR"
  21. ;;
  22. *)
  23. echo "Setting this directory"
  24. ;;
  25. esac
  26. # create.sh
  27. echo 'cp template.cpp $1.cpp \n code $1.cpp' > $DIR/create.sh
  28. # template
  29. read -p "Press enter to create template" A
  30. code $DIR/template.cpp
  31. # run.sh
  32. echo 'g++ -o $1.out -g $1.cpp\n./$1.out' > $DIR/run.sh
  33. # make all executable
  34. chmod +x $DIR/create.sh
  35. chmod +x $DIR/run.sh