aboutsummaryrefslogtreecommitdiff
path: root/bin/bashtard
blob: 2f14d020385c66945a467e148037c8ff43cc0c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# SPDX-FileCopyrightText: 2022 Patrick Spek <p.spek@tyil.nl>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

export BASHTARD_BIN="$0"
export BASHTARD_NAME="$(basename "$0")"
export BASHTARD_ETCDIR="/etc/$BASHTARD_NAME"
export BASHTARD_LIBDIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)/lib"
export BASHTARD_SHAREDIR="$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)/share"

main() {
	if ! command -v bash > /dev/null
	then
		printf "You need bash to run %s utilities\n" "$BASHTARD_NAME" >&2
		exit 1
	fi

	exec bash "$BASHTARD_LIBDIR/main.bash" "$@"
}

main "$@"