Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/montymxb/closure-compiler-bash-wrapper
- Owner: montymxb
- License: mit
- Created: 2016-02-25T21:33:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-02-25T22:12:57.000Z (over 8 years ago)
- Last Synced: 2023-08-06T06:24:01.422Z (over 1 year ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# closure-compiler-bash-wrapper
A bash script wrapper for the closure-compiler toolBased 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
Download the closure-compiler tool to start. Place it wherever you like, but in this example we'll just put it in /
Unzip and move the contents to /closure-compiler
Place the closure-compiler.sh file from this example in the /closure-compiler folder as well.
Make the closure-compiler.sh file executable with chmod 755 closure-compiler.sh
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'
Update the
CC_PATH variable at the top of closure-compiler.sh if you used a directory other than /closure-compiler
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!