forked from asdf-vm/asdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasdf
More file actions
executable file
·117 lines (88 loc) · 2.33 KB
/
Copy pathasdf
File metadata and controls
executable file
·117 lines (88 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env bash
# shellcheck source=lib/utils.sh
source "$(dirname "$(dirname "$0")")/lib/utils.sh"
load_cmd() {
for cmd in "$@"; do
# shellcheck disable=SC1091
source "$(dirname "$(dirname "$0")")/lib/commands/$cmd.sh"
done
}
cmd_args=("${@:2}")
case "$1" in
"exec")
load_cmd "shim-exec"
shim_exec_command "${cmd_args[@]}";;
"env")
load_cmd "shim-env"
shim_env_command "${cmd_args[@]}";;
"where")
load_cmd "where"
where_command "${cmd_args[@]}";;
"which")
load_cmd "which"
which_command "${cmd_args[@]}";;
"update")
load_cmd "update"
update_command "${cmd_args[@]}";;
"install")
load_cmd "install" "reshim"
install_command "${cmd_args[@]}";;
"uninstall")
load_cmd "uninstall" "reshim"
uninstall_command "${cmd_args[@]}";;
"current")
load_cmd "current" "plugin-list"
current_command "${cmd_args[@]}";;
"sh-shell")
load_cmd "version_commands"
shell_command "${cmd_args[@]}";;
"shell")
echo "Shell integration is not enabled. Please ensure you source asdf in your shell setup."
exit 1;;
"local")
load_cmd "version_commands"
local_command "${cmd_args[@]}";;
"global")
load_cmd "version_commands"
global_command "${cmd_args[@]}";;
"list")
load_cmd "list"
list_command "${cmd_args[@]}";;
"list-all")
load_cmd "list-all"
list_all_command "${cmd_args[@]}";;
"reshim")
load_cmd "reshim"
reshim_command "${cmd_args[@]}";;
"plugin-add")
load_cmd "plugin-add"
plugin_add_command "${cmd_args[@]}";;
"plugin-list")
load_cmd "plugin-list"
plugin_list_command "${cmd_args[@]}";;
"plugin-list-all")
load_cmd "plugin-list-all"
plugin_list_all_command "${cmd_args[@]}";;
"plugin-update")
load_cmd "plugin-update"
plugin_update_command "${cmd_args[@]}";;
"plugin-remove")
load_cmd "plugin-remove"
plugin_remove_command "${cmd_args[@]}";;
# Undocumented commands for development
"plugin-push")
load_cmd "plugin-push"
plugin_push_command "${cmd_args[@]}";;
"plugin-test")
load_cmd "plugin-test"
plugin_test_command "${cmd_args[@]}";;
"shim-versions")
load_cmd "shim_versions"
shim_versions_command "${cmd_args[@]}";;
"--version")
asdf_version "${cmd_args[@]}";;
*)
load_cmd "help"
help_command
exit 1;;
esac