From ad62d1da67831c6de287835a1188cead7c3f4ff1 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sun, 17 Apr 2022 22:26:33 +0200 Subject: Add a Makefile for easy installation --- lib/main.bash | 4 ++-- lib/subcommands/sync.bash | 2 +- lib/subcommands/sysinfo.bash | 3 ++- lib/util.bash | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/main.bash b/lib/main.bash index 063b05f..851da1d 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -7,7 +7,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/util.bash" source "$(dirname "${BASH_SOURCE[0]}")/logging.bash" main() { - debug "$BASHTARD_NAME/main" "Running from $BASHTARD_BASEDIR" + debug "$BASHTARD_NAME/main" "Running from $BASHTARD_LIBDIR" debug "$BASHTARD_NAME/main" "Configuration dir is at $BASHTARD_ETCDIR" debug "$BASHTARD_NAME/main" "> $0 $*" @@ -17,7 +17,7 @@ main() { debug "$BASHTARD_NAME/main" "Handling subcommand '$BASHTARD_COMMAND'" - subcommand_src="$BASHTARD_BASEDIR/lib/subcommands/$BASHTARD_COMMAND.bash" + subcommand_src="$BASHTARD_LIBDIR/subcommands/$BASHTARD_COMMAND.bash" debug "$BASHTARD_NAME/main" "Checking $subcommand_src" diff --git a/lib/subcommands/sync.bash b/lib/subcommands/sync.bash index af5f282..8fce0b6 100644 --- a/lib/subcommands/sync.bash +++ b/lib/subcommands/sync.bash @@ -25,7 +25,7 @@ subcommand() while read -r playbook do info "bashtard/sync" "Syncing $playbook" - "$BASHTARD_BASEDIR/bin/$BASHTARD_NAME" sync "$playbook" + "$BASHTARD_BIN" sync "$playbook" done < "$BASHTARD_ETCDIR/registry.d/${BASHTARD_PLATFORM[fqdn]}" } diff --git a/lib/subcommands/sysinfo.bash b/lib/subcommands/sysinfo.bash index 5010798..7b83e32 100644 --- a/lib/subcommands/sysinfo.bash +++ b/lib/subcommands/sysinfo.bash @@ -1,8 +1,9 @@ #!/usr/bin/env bash subcommand() { - printf "%-15s %s\n" "basedir" "$BASHTARD_BASEDIR" printf "%-15s %s\n" "etcdir" "$BASHTARD_ETCDIR" + printf "%-15s %s\n" "libdir" "$BASHTARD_LIBDIR" + printf "%-15s %s\n" "sharedir" "$BASHTARD_SHAREDIR" for key in "${!BASHTARD_PLATFORM[@]}" do diff --git a/lib/util.bash b/lib/util.bash index 72a41a8..98bdc95 100644 --- a/lib/util.bash +++ b/lib/util.bash @@ -38,8 +38,8 @@ config_for() { fi files+=( - "$BASHTARD_BASEDIR/etc/os.d/${BASHTARD_PLATFORM[key]}" - "$BASHTARD_BASEDIR/etc/defaults" + "$BASHTARD_SHAREDIR/os.d/${BASHTARD_PLATFORM[key]}" + "$BASHTARD_SHAREDIR/defaults" ) # Check configuration files -- cgit v1.1