This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/hoogle.sh
2022-10-12 09:43:42 +02:00

23 lines
678 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || :
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 --port $((${PORT_OFFSET:-$(((16#$(echo \"fradrive $(whoami)\" | sha256sum | head -c 16)) % 1000))} + 8081))}