From 97ea86450b3619cca8a0d562a669f5678d5df168 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sun, 17 Apr 2022 10:42:09 +0200 Subject: Add functionality to work with playbooks --- lib/main.bash | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/main.bash') diff --git a/lib/main.bash b/lib/main.bash index ce41b92..063b05f 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -13,12 +13,11 @@ main() { [[ -z $1 ]] && usage && exit 2 - local subcommand="$1" - shift + export BASHTARD_COMMAND="$1" ; shift - debug "$BASHTARD_NAME/main" "Handling subcommand '$subcommand'" + debug "$BASHTARD_NAME/main" "Handling subcommand '$BASHTARD_COMMAND'" - subcommand_src="$BASHTARD_BASEDIR/lib/subcommands/$subcommand.bash" + subcommand_src="$BASHTARD_BASEDIR/lib/subcommands/$BASHTARD_COMMAND.bash" debug "$BASHTARD_NAME/main" "Checking $subcommand_src" @@ -38,7 +37,6 @@ main() { # Export BASHTARD_ variables export BASHTARD_PLATFORM - export BASHTARD_SYSTEM="${subcommand%%/*}" # Source the file defining the subcommand. debug "$BASHTARD_NAME/main" "Sourcing $subcommand_src" @@ -50,7 +48,7 @@ main() { debug "$BASHTARD_NAME/main" "\$TMPDIR set to $TMPDIR" # Actually perform the subcommand - debug "$BASHTARD_NAME/main" "Running subcommand '$subcommand'" + debug "$BASHTARD_NAME/main" "Running subcommand '$BASHTARD_COMMAND'" subcommand "$@" local subcommand_exit=$? -- cgit v1.1