Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/montymxb/closure-compiler-bash-wrapper

A bash script wrapper for the closure-compiler tool
https://github.com/montymxb/closure-compiler-bash-wrapper

Last synced: 2 days ago
JSON representation

A bash script wrapper for the closure-compiler tool

Awesome Lists containing this project

README

        

# closure-compiler-bash-wrapper
A bash script wrapper for the closure-compiler tool

Based off of an older yuijs bash wrapper, this script allows you to use closure compiler with ease on a variable amount of js files, including wildcards. Allowing you to compress just one, two or a whole folder if you wish.

# Installation



  1. Download the closure-compiler tool to start. Place it wherever you like, but in this example we'll just put it in /


  2. Unzip and move the contents to /closure-compiler


  3. Place the closure-compiler.sh file from this example in the /closure-compiler folder as well.


  4. Make the closure-compiler.sh file executable with chmod 755 closure-compiler.sh


  5. Set up a bash alias to closure-compiler.sh in your ~/.bash_profile. It would look a little something like this

    alias closure-compiler='/closure-compiler/closure-compiler.sh'


  6. Update the
    CC_PATH variable at the top of closure-compiler.sh if you used a directory other than /closure-compiler


  7. You can invoke the closure-compiler wrapper from the terminal via closure-compiler [args]

# Using

You can invoke the wrapper in a number of ways:

```

# single file

closure-compiler file.js

#creates file-min.js

```

```

# multiple files

closure-compiler file1.js file2.js file3.js

#creates file1-min.js file2-min.js file3-min.js

```

```

# wildcard, compiles all files ending in .js in the current folder

closure-compiler *.js

# creates [ORIGINAL_NAME]-min.js

```

```

# wildcard in a folder

closure-compiler js-files/*.js

# creates js-files/[ORIGINAL_NAME]-min.js

```

This is a brief usage coverage, feel free to add parameters to multiple folders or files in manner that makes sense to you.

# License
MIT License

# Contact
If you have any problems open up an issue or reach me at .

In most cases feel free to hack away at this little script to make it suite your needs!