on master help sign in
Rename check-stylish.sh and make it a bit more user friendly.
commitf8e3df036b43f7be65bac847f14828d3c4997f42 authorEcho Nolan <echo@echonolan.net> dateWed 12 Oct 2016, 14:54 (10 years ago) parentaea713d
2 files changed+10−13
.travis.yml+1−1 check-stylish.sh → stylize.sh+9−12
.travis.yml+1−1
@@ -69,7 +69,7 @@ before_install:
6969 export ZCAT=gzcat;
7070 export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH;
7171 fi
72− - if [ -n "$STYLISH" ]; then ./check-stylish.sh; exit $?; fi
72+ - if [ -n "$STYLISH" ]; then ./stylize.sh; exit $?; fi
7373
7474install:
7575 - cabal --version
check-stylish.sh → stylize.shrenamed+9−12
@@ -2,14 +2,6 @@
22
33set -e
44
5−function fail_maybe_explain {
6− if [ -n "$TRAVIS" ];
7− then
8− echo "Run ./check-stylish.sh locally to stylize your files / debug this"
9− fi
10− exit 1
11−}
12−
135if [ -n "$TRAVIS" ];
146then
157 mkdir -p ~/.local/bin
@@ -26,16 +18,21 @@ if [ -s stylish-out ];
2618then
2719 echo "Stylish-haskell reported an error :("
2820 cat stylish-out
29− fail_maybe_explain
21+ exit 1
3022fi
3123
3224rm stylish-out
3325
3426if git status --porcelain|grep .; # true if there was any output
3527then
36− echo "Running stylish-haskell changed 1 or more files :(";
37− fail_maybe_explain
28+ echo "Git tree is dirty after stylizing.";
29+ if [ -n "$TRAVIS" ];
30+ then
31+ echo "Since we're on Travis, this is a build failure."
32+ echo "Run ./stylize.sh to stylize your tree and push the changes."
33+ exit 1
34+ fi
3835else
39− echo "Stylish is happy :)";
36+ echo "Stylish didn't change anything :)"
4037 exit 0;
4138fi