build(backend): rewrite backend hoogle.sh
This commit is contained in:
parent
b495fec65a
commit
0883e2de21
15
hoogle.sh
15
hoogle.sh
@ -6,17 +6,4 @@ set -e
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || :
|
stack --work-dir .stack-work-doc --jobs 4 hoogle -- ${@:-server --local --port $HOOGLE_PORT}
|
||||||
|
|
||||||
move-back() {
|
|
||||||
mv -vT .stack-work .stack-work-doc
|
|
||||||
[[ -d .stack-work-build ]] && mv -vT .stack-work-build .stack-work
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ -d .stack-work-doc ]]; then
|
|
||||||
[[ -d .stack-work ]] && mv -vT .stack-work .stack-work-build
|
|
||||||
mv -vT .stack-work-doc .stack-work
|
|
||||||
trap move-back EXIT
|
|
||||||
fi
|
|
||||||
|
|
||||||
stack hoogle -- ${@:-server --local --work-dir .stack-work-doc --port $HOOGLE_PORT}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user