mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
parent
3379af845e
commit
c5b8b3c128
2
asdf.nu
2
asdf.nu
@ -99,7 +99,7 @@ module asdf {
|
||||
|
||||
# list all available plugins
|
||||
export def "asdf plugin list all" [] {
|
||||
let template = '(?P<name>.+)\s+?(?P<installed>[*]?)(?P<repository>(?:git|http).+\.git)'
|
||||
let template = '(?P<name>.+)\s+?(?P<installed>[*]?)(?P<repository>(?:git|http|https).+)'
|
||||
let is_installed = { |it| $it.installed == '*' }
|
||||
|
||||
^asdf plugin list all |
|
||||
|
@ -9,6 +9,14 @@ setup() {
|
||||
if ! command -v nu; then
|
||||
skip "Nu is not installed"
|
||||
fi
|
||||
|
||||
setup_asdf_dir
|
||||
setup_repo
|
||||
install_dummy_plugin
|
||||
}
|
||||
|
||||
teardown() {
|
||||
clean_asdf_dir
|
||||
}
|
||||
|
||||
cleaned_path() {
|
||||
@ -110,3 +118,20 @@ cleaned_path() {
|
||||
result=$(echo "$output" | grep "ASDF INSTALLED PLUGINS:")
|
||||
[ "$result" != "" ]
|
||||
}
|
||||
|
||||
@test "parses the output of asdf plugin list all" {
|
||||
run nu -c "
|
||||
hide-env -i asdf
|
||||
hide-env -i ASDF_DIR
|
||||
let-env PATH = ( '$(cleaned_path)' | split row ':' )
|
||||
let-env ASDF_NU_DIR = '$PWD'
|
||||
|
||||
source asdf.nu
|
||||
asdf plugin list all | to csv -n"
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
[ "$output" = "\
|
||||
bar,false,http://example.com/bar
|
||||
dummy,true,http://example.com/dummy
|
||||
foo,false,http://example.com/foo" ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user