clean-old-stack-libs.sh: pushd to show dir and run stack script

- bail if error
- make shell script executable instead
This commit is contained in:
Jens Petersen 2020-05-19 15:24:13 +08:00
parent 95b3cae91d
commit ca686bacd1
2 changed files with 6 additions and 2 deletions

8
etc/diskspace/clean-old-stack-libs.sh Normal file → Executable file
View File

@ -1,10 +1,14 @@
#!/bin/sh
set -e
if [ $# != 1 ]; then
echo "Usage: $0 [nightly|lts-xx]"
exit 1
fi
popd ~/stackage/automated/work/$1/unpack-dir/.stack-work/install/x86_64-linux/*/*/lib/x86_64-linux-ghc-*
SRCDIR=$(dirname $0)
~/stackage/etc/diskspace/remove-old-stack-work-libs.hs
pushd ~/stackage/automated/work/$1/unpack-dir/.stack-work/install/x86_64-linux/*/*/lib/x86_64-linux-ghc-*
stack --resolver lts-14 script ${SRCDIR}/remove-old-stack-work-libs.hs

0
etc/diskspace/remove-old-stack-work-libs.hs Executable file → Normal file
View File