halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
468 stars 87 forks source link

Unable to run `asdf list-all java` under MSYS2 #24

Closed empjustine closed 5 years ago

empjustine commented 5 years ago

Expected:

$ asdf list-all graalvm
1.0.0-rc1
1.0.0-rc10
1.0.0-rc11
1.0.0-rc12
1.0.0-rc13
1.0.0-rc14
1.0.0-rc15
1.0.0-rc16
1.0.0-rc2
1.0.0-rc3
1.0.0-rc4
1.0.0-rc5
1.0.0-rc6
1.0.0-rc7
1.0.0-rc8
1.0.0-rc9
19.0.0
19.0.2
19.1.0
19.1.1
19.2.0
19.2.0-dev-b01
19.2.0.1
19.2.1

I got instead:

$ asdf list-all java
/c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/list-all: line 1: functions: command not found

Is plugins/${_PLUGIN_NAME}/bin/ expected to be in $PATH?

My environment:

$ head /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/*
==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/functions <==
#!/usr/bin/env bash

PLUGIN_HOME=$(dirname $(dirname "${0}"))
CACHE_DIR="/tmp/asdf-java.cache"
mkdir -p ${CACHE_DIR}

case $(uname -s) in
    Darwin) OS="mac"
            SHA256SUM="gsha256sum"
            STAT="stat -f %c ${CACHE_DIR}/*"

==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/install <==
functions
==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/list-all <==
functions

$ set | grep -E 'OSTYPE|ASDF'
ASDF_BIN=/c/Users/emp.justine/.local/share/_asdf/bin
ASDF_CONFIG_FILE=/c/Users/emp.justine/.config/_asdfrc
ASDF_DATA_DIR=/c/Users/emp.justine/.local/share/_asdf
ASDF_DIR=/c/Users/emp.justine/.local/share/_asdf
ASDF_USER_SHIMS=/c/Users/emp.justine/.local/share/_asdf/shims
OSTYPE=msys

$ asdf current
graalvm        No version set for graalvm; please run `asdf <global | local> graalvm <version>`
java           No version set for java; please run `asdf <global | local> java <version>`
empjustine commented 5 years ago

I found the reason, install and list-all are symlinks and as usual Windows sucks at them.