install.sh 587 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. installDir="$HOME/.local/bin/"
  3. sgDir="$HOME/.sg"
  4. libDir="/usr/local/lib/SimplyGit/"
  5. if [ ! -d $installDir ]; then
  6. echo "Making $installDir"
  7. mkdir -p $installDir
  8. fi
  9. if [ ! -d $libDir ]; then
  10. echo "Making $libDir"
  11. sudo mkdir -p $libDir
  12. fi
  13. if [ ! -d $sgDir ]; then
  14. echo "Making $sgDir"
  15. mkdir -p $sgDir
  16. fi
  17. echo "Copying bin"
  18. cp ./sg $installDir
  19. if [ ! -f $sgDir/sg.config ]; then
  20. echo "Copying default config"
  21. cp ./example.config $sgDir/sg.config
  22. else
  23. echo "Found config file not overwriting"
  24. fi
  25. echo "Calling sudo to copy libs"
  26. sudo cp ./lib/SimplyGit/* $libDir