Merge pull request #1 from legion-github/elrido-uglifyjs
Add uglifyjs as submodule THX legion!
This commit is contained in:
commit
7cee995cd7
3 changed files with 43 additions and 0 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "uglifyjs"]
|
||||
path = uglifyjs
|
||||
url = https://github.com/mishoo/UglifyJS.git
|
39
install.sh
Executable file
39
install.sh
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh -eu
|
||||
|
||||
myname="$(readlink -ev "$0")"
|
||||
compiler='uglifyjs/bin/uglifyjs'
|
||||
|
||||
SOURCES='cfg css img lib tpl index.php'
|
||||
JSDIR='js'
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
printf 'Usage: %s <destdir>\n' "${0##*/}"
|
||||
exit
|
||||
fi
|
||||
|
||||
destdir="$1"
|
||||
shift
|
||||
|
||||
if [ ! -d "$destdir" ]; then
|
||||
printf 'Error: %s: Not directory\n' "$destdir"
|
||||
exit 1
|
||||
fi
|
||||
destdir="$(readlink -ev "$destdir")"
|
||||
|
||||
cd "${myname%/*}"
|
||||
cp -aurt "$destdir" -- $SOURCES
|
||||
|
||||
mkdir -p -- "$destdir/js"
|
||||
for src in "$JSDIR"/*.js; do
|
||||
[ -f "$src" ] ||
|
||||
continue
|
||||
printf 'Processing %s ... ' "$src"
|
||||
|
||||
rc='done'
|
||||
$compiler -nc -c -o "$destdir/js/${src##*/}" "$src" || rc='fail'
|
||||
|
||||
printf '%s\n' "$rc"
|
||||
|
||||
[ "$rc" = 'done' ] ||
|
||||
exit 1
|
||||
done
|
1
uglifyjs
Submodule
1
uglifyjs
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit ef4d776aedee6cbc8959a8e76403b82523615d3a
|
Loading…
Reference in a new issue