From 034ddb173d4b1c4ab740a0b6332347afa46c1ece Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Fri, 6 Oct 2023 05:56:46 -0700 Subject: [PATCH] wip: Add `init` subcommand --- lib/commands/command-init.bash | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/commands/command-init.bash diff --git a/lib/commands/command-init.bash b/lib/commands/command-init.bash new file mode 100644 index 000000000..3bf92a0cc --- /dev/null +++ b/lib/commands/command-init.bash @@ -0,0 +1,35 @@ +# -*- sh -*- +# shellcheck source=lib/functions/plugins.bash +. "$(dirname "$(dirname "$0")")/lib/functions/plugins.bash" + +init_command() { + local shell=$1 + local dir + dir="$(dirname "$(dirname "$0")")" + + case $shell in + sh) + cat "$dir/asdf.sh" + ;; + bash) + cat "$dir/asdf.sh" + ;; + zsh) + cat "$dir/asdf.sh" + ;; + fish) + cat "$dir/asdf.fish" + ;; + elvish) + cat "$dir/asdf.elv" + ;; + nushell) + cat "$dir/asdf.nu" + ;; + powershell) + cat "$dir/asdf.ps1" + ;; + esac +} + +init_command "$@"