Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save disassembler/5a006043a92485d23304524df3d0eb64 to your computer and use it in GitHub Desktop.

Select an option

Save disassembler/5a006043a92485d23304524df3d0eb64 to your computer and use it in GitHub Desktop.
set +e
export PATH=/nix/store/79j0pfqnqigdbbn6g5d4ls4jbj8bp5p0-stylish-haskell-0.9.2.0/bin:$PATH
export LOCALE_ARCHIVE="/nix/store/vg0s4sl74f5ik64wrrx0q9n6m48vvmgs-glibc-locales-2.26-131/lib/locale/locale-archive"
export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8
cp -a /nix/store/pr6j8ygrbb3m1mbvzsrchr7ykn7r14a8-devops-942-hydra-fixes orig
cp -a /nix/store/pr6j8ygrbb3m1mbvzsrchr7ykn7r14a8-devops-942-hydra-fixes stylish
chmod -R +w stylish
cd stylish
find . -type f -name "*hs" -not -name 'HLint.hs' -exec stylish-haskell -i {} \;
cd ..
diff --brief --recursive orig stylish > /dev/null
EXIT_CODE=$?
if [[ $EXIT_CODE != 0 ]]
then
mkdir -p $out/nix-support
diff -ur orig stylish > $out/stylish.diff
echo "file none $out/stylish.diff" > $out/nix-support/hydra-build-products
echo "*** Stylish-haskell found changes that need addressed first"
echo "*** Please run \`nix-shell -A fixStylishHaskell\` and commit changes"
echo "*** or apply the diff generated by hydra if you don't have nix."
exit $EXIT_CODE
else
echo $EXIT_CODE > $out
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment