@@ -35,7 +35,11 @@ namespace :asdf do
3535 end
3636 end
3737 else
38- execute ( :git , "clone" , fetch ( :asdf_repository ) , fetch ( :asdf_path ) , "--branch" , fetch ( :asdf_version ) )
38+ execute :git , "clone" , fetch ( :asdf_repository ) , fetch ( :asdf_path )
39+ within ( fetch ( :asdf_path ) ) do
40+ execute :git , "checkout" , "v#{ fetch ( :asdf_version ) } "
41+ execute :echo , fetch ( :asdf_version ) , ">" , "version.txt"
42+ end
3943 info "ASDF #{ fetch ( :asdf_version ) } is installed on #{ fetch ( :asdf_path ) } "
4044 end
4145 end
@@ -121,8 +125,9 @@ namespace :load do
121125 set :asdf_roles , fetch ( :asdf_roles , :all )
122126 set :asdf_ruby_use_jemalloc , fetch ( :asdf_ruby_use_jemalloc , true )
123127 set :asdf_jemalloc_path , fetch ( :asdf_jemalloc_path , "/usr/include/jemalloc" )
124- set :asdf_tools , fetch ( :asdf_tools , %w[ ruby nodejs ] )
128+ set :asdf_tools , fetch ( :asdf_tools , File . read ( ".tool-versions" ) . lines . map ( & :split ) . to_h . keys ) # Autodetect from .tool-versions
125129 set :asdf_map_ruby_bins , fetch ( :asdf_map_ruby_bins , %w[ rake gem bundle ruby rails ] )
126130 set :asdf_map_nodejs_bins , fetch ( :asdf_map_nodejs_bins , %w[ node npm yarn ] )
131+ set :asdf_map_python_bins , fetch ( :asdf_map_python_bins , %w[ python pip ] )
127132 end
128133end
0 commit comments