diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-04-17 10:42:09 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-04-17 10:42:09 +0200 |
commit | 97ea86450b3619cca8a0d562a669f5678d5df168 (patch) | |
tree | 237c5c2989dd43e7da2c67529a899a3a8218577b /lib/main.bash | |
parent | e3f5c683a1d2b34be698cb59d77d379d38458cad (diff) |
Add functionality to work with playbooks
Diffstat (limited to 'lib/main.bash')
-rw-r--r-- | lib/main.bash | 10 |
1 files changed, 4 insertions, 6 deletions
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=$? |