~/paste/10771
~/paste/10771
~/paste/10771

  1. #!/bin/bash
  2.  
  3. #Run this script to download and install the latest CH build from build.sk89q.com. It names
  4. #it and symlinks it properly.
  5.  
  6. version='3.3.1'
  7.  
  8. #Delete old downloads
  9. if [ -a commandhelper-$version-SNAPSHOT.jar ]; then
  10.         rm -f commandhelper-$version-SNAPSHOT.jar
  11. fi
  12. #Download the latest version
  13. #wget http://build.sk89q.com/job/CommandHelper/lastSuccessfulBuild/artifact/target/commandhelper-$version-SNAPSHOT.jar
  14. echo "Downloading latest build..."
  15. wget http://builds.enginehub.org/job/commandhelper/last-successful/download/commandhelper-$version-SNAPSHOT.zip
  16. echo "Unzipping..."
  17. unzip -p commandhelper-$version-SNAPSHOT.zip CommandHelper.jar > commandhelper-$version-SNAPSHOT.jar
  18. rm -f commandhelper-$version-SNAPSHOT.zip
  19.  
  20. echo "Gathering build info..."
  21. #Store the build hash from the version number
  22. buildhash=$(unzip -c commandhelper-$version-SNAPSHOT.jar plugin.yml | grep 'version: ".*"' | sed -rn 's/version: "'$version'-SNAPSHOT:[[:digit:]]{4}-(.*),.*"/\1/p')
  23. #Build the time string
  24. timestamp=$(date +"%Y%m%d")
  25. #rename the file
  26. filename=CommandHelper-$version-$timestamp-$buildhash.jar
  27.  
  28. echo "Naming file properly and moving into position..."
  29. mv commandhelper-$version-SNAPSHOT.jar $filename
  30. #Now remove the old symlink
  31. rm CommandHelper.jar
  32. #And create the new one
  33.  
  34. echo "Creating symlink..."
  35. ln -s $filename CommandHelper.jar
  36.  
  37. echo "Updating syntax file..."
  38. #Update the syntax file for this version
  39. java -jar CommandHelper.jar syntax vim > ~/.vim/syntax/commandhelper.vim
  40.  
  41. echo "Done!"
Language: bash
Posted by Anonymous at 19 Aug 2013, 03:49:24 UTC