Update Travis config to run format check

This commit is contained in:
nitrohorse
2019-08-03 19:31:37 -07:00
parent d01b88520a
commit 3e63b62881
3 changed files with 21 additions and 11 deletions

View File

@ -1,12 +1,14 @@
#!/bin/bash
# A custom script, that formats the file(s) with html-beautify,
# but instead of changing it, it only errors with 0/1 if it needs to be changed
# Ref: https://web.archive.org/web/20190522172323/https://medium.com/@jtomaszewski/keep-your-code-clean-forever-65c71f7f2df
APPDIR=$(realpath $(dirname $(dirname $0)))
APPDIR=$(readlink -f $(dirname $(dirname $0)))
TMPDIR=$(mktemp -d)
cd $APPDIR
for line in $*; do
filepath=$(realpath $line)
filepath=$(readlink -f $line)
file=${filepath/$APPDIR\//}
mkdir -p $TMPDIR/$(dirname $file)
cp $APPDIR/$file $TMPDIR/$file