ampache_react/hooks/pre-commit
Phyks (Lucas Verney) fffe9c4cd3 Major code review
Major code review, cleaning the code and adding a lot of comments. Also
implements a separate store to keep entities with a reference count and
garbage collection. This closes #15.

Known issues at the moment are:
* Webplayer is no longer working, it has to be refactored.
* AlbumPage is to be implemented.
2016-08-10 21:40:25 +02:00

27 lines
586 B
Plaintext
Executable File

set -e
# Get against which ref to diff
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Something weird, initial commit
exit 1
fi
# List all the modified CSS and JS files (not in output path)
css_js_files=$(git diff-index --name-only $against | grep -e '.\(jsx\?\)\|\(s\?css\)$' | grep -v "^public")
# Nothing more to do if no JS files was committed
if [ -z "$css_js_files" ]
then
exit 0
fi
# Else, rebuild as production, run tests and add files
echo "Rebuilding dist JavaScript files…"
npm test
npm run clean
npm run build:prod
git add public