Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/build-js.sh

25 lines
662 B
Bash
Raw Normal View History

2016-04-27 17:21:12 +05:00
#!/usr/bin/env bash
set -e
root=$(readlink -e $(dirname $0))
cd $root
if [ -z "$GOPATH" ]; then
export GOPATH=$PWD/go
mkdir -p $GOPATH
fi
if [ ! -f $GOPATH/bin/minify ]; then
2016-04-30 17:26:14 +05:00
echo "set up minifiy"
go get -v github.com/tdewolff/minify/cmd/minify
2016-04-27 17:21:12 +05:00
fi
echo -e "//For source code and license information please check https://github.com/majestrate/nntpchan \n" > ./contrib/static/nntpchan.js
2016-04-30 17:26:14 +05:00
echo -n "minify "
2016-04-27 18:36:57 +05:00
cat ./contrib/js/main.js_ | $GOPATH/bin/minify --mime=text/javascript >> ./contrib/static/nntpchan.js
2016-04-27 17:21:12 +05:00
for f in ./contrib/js/*.js ; do
2016-04-30 17:26:14 +05:00
echo -n "."
2016-04-27 17:21:12 +05:00
cat $f | $GOPATH/bin/minify --mime=text/javascript >> ./contrib/static/nntpchan.js
done
2016-04-30 17:26:14 +05:00
echo "ok"