Last active
August 13, 2018 20:06
-
-
Save tylermercer/7f3553ad66192e3855c2867dc81a8d3e to your computer and use it in GitHub Desktop.
A simple bash script for merging JAR files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash/ | |
#Based on http://sureshatt.blogspot.com/2012/03/unzip-all-jars-at-once.html | |
#Command line args are ($1) the directory to pull jars from and ($2) | |
mkdir unzippedjarfilesthatwillbemerged; | |
x=0; | |
ls -1 $1/*.jar > filelist | |
for filename in `cat filelist` | |
do | |
#echo $filename; | |
unzip -o $filename -d unzippedjarfilesthatwillbemerged; | |
x=$(( $x + 1 )); | |
done; | |
echo $x JARs merged; | |
jar -cvf $2 -C unzippedjarfilesthatwillbemerged .; | |
rm -r unzippedjarfilesthatwillbemerged; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment