Skip to content

Instantly share code, notes, and snippets.

@aerouk
Last active August 29, 2015 14:03
Show Gist options
  • Save aerouk/266982c6aff84ac650bf to your computer and use it in GitHub Desktop.
Save aerouk/266982c6aff84ac650bf to your computer and use it in GitHub Desktop.
Install YUI Compressor (Java is a prerequisite)

Usage

  1. Ensure Java is installed. yum -y install java7
  2. Put the shell script somewhere you can access and execute it. If you're having trouble executing the file, make sure you chmod the file so you can execute it.
  3. Run the script.
  4. Type the command yc to ensure it installed correctly.

Now you can use the following command to get started:

yc style.css -o style.min.css

#!/bin/sh
sudo mkdir -p /usr/share/java
sudo wget https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar -P /usr/share/java
sudo echo "#!/bin/sh" >> /usr/bin/yc
sudo echo "" >> /usr/bin/yc
sudo echo "java -jar /usr/share/java/yuicompressor-2.4.8.jar \"$@\"" >> /usr/bin/yc
sudo chmod +x /usr/bin/yc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment