Use erlang as an example source

This commit is contained in:
Akash Manohar J 2014-11-29 20:16:29 +05:30
parent 643d3419cb
commit f60eced156
4 changed files with 44 additions and 9 deletions

View File

@ -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

View File

@ -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 "$@"

View File

@ -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
View 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