mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Use erlang as an example source
This commit is contained in:
parent
643d3419cb
commit
f60eced156
10
README.md
10
README.md
@ -8,12 +8,12 @@
|
||||
asdf install <package> <version>
|
||||
asdf uninstall <package> <version>
|
||||
asdf list <package>
|
||||
asdf list <package> -a
|
||||
asdf list-all <package>
|
||||
asdf use <package> <version>
|
||||
asdf source add <package> <source>
|
||||
asdf source remove <package>
|
||||
asdf source update --all
|
||||
asdf source update <package>
|
||||
asdf source-add <package> <source>
|
||||
asdf source-remove <package>
|
||||
asdf source-update
|
||||
asdf source-update <package>
|
||||
|
||||
## `.asdf-versions` file
|
||||
|
||||
|
2
bin/asdf
2
bin/asdf
@ -4,4 +4,4 @@ source $(dirname $(dirname $0))/lib/asdf/utils.sh
|
||||
source $(dirname $(dirname $0))/lib/asdf.sh
|
||||
source $(dirname $(dirname $0))/lib/asdf/docs.sh
|
||||
|
||||
run_command $@
|
||||
run_command "$@"
|
||||
|
27
lib/asdf.sh
27
lib/asdf.sh
@ -28,6 +28,7 @@ check_and_run() {
|
||||
run_command() {
|
||||
check_and_run "--version" $1 asdf_version "${@:2}"
|
||||
check_and_run "list" $1 list_command "${@:2}"
|
||||
check_and_run "list-all" $1 list_all_command "${@:2}"
|
||||
|
||||
# if [ "$1" = "list" ]
|
||||
# then
|
||||
@ -40,13 +41,33 @@ run_command() {
|
||||
}
|
||||
|
||||
|
||||
list_all_command() {
|
||||
asdf_path=$(asdf_dir)
|
||||
if [ -d ${asdf_path}/sources/$1 ]
|
||||
then
|
||||
echo ./$(asdf_dir)/sources/$1/list-all
|
||||
else
|
||||
display_error "no such package"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
list_command() {
|
||||
echo ./$(asdf_dir)/sources/$1/list
|
||||
asdf_path=$(asdf_dir)
|
||||
if [ -d ${asdf_path}/sources/$1 ]
|
||||
then
|
||||
# echo ./$(asdf_dir)/sources/$1/list
|
||||
#TODO list versions installed with the installs/erlang/.installs file
|
||||
# the .installs file will have lines of the format "version hash"
|
||||
else
|
||||
display_error "no such package"
|
||||
fi
|
||||
}
|
||||
|
||||
display_error() {
|
||||
echo $1
|
||||
}
|
||||
|
||||
help_all() {
|
||||
echo "display help message"
|
||||
}
|
||||
|
||||
run_command "$@"
|
||||
|
14
sources/erlang/list-all
Normal file
14
sources/erlang/list-all
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
versions=(
|
||||
17.3.4
|
||||
17.3
|
||||
17.2
|
||||
17.1
|
||||
17.0
|
||||
)
|
||||
|
||||
for version in "${versions[@]}"
|
||||
do
|
||||
echo $version
|
||||
done
|
Loading…
Reference in New Issue
Block a user