A fork of RinRi's CPSRC. A tool for C++ Competitive programmers to do stuff
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

42 行
910 B

  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