mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-01-30 17:23:02 -05:00
This reverts commit e3a4d46918.
This fixes issue #467. Cygwin can be configured to do what this commit did
by setting the following `export CYGWIN=winsymlinks:native`
This commit is contained in:
committed by
Marco Vermeulen
parent
29a7f4cca5
commit
abc19ee1d0
@@ -84,17 +84,5 @@ function __sdkman_link_candidate_version {
|
||||
if [[ -h "${SDKMAN_CANDIDATES_DIR}/${candidate}/current" || -d "${SDKMAN_CANDIDATES_DIR}/${candidate}/current" ]]; then
|
||||
rm -f "${SDKMAN_CANDIDATES_DIR}/${candidate}/current"
|
||||
fi
|
||||
|
||||
function cygwin_ln(){
|
||||
mapfile -t ph < <(cygpath -aw "$@")
|
||||
[ -d "$2" ] && d=/d || d=
|
||||
cmd /c mklink $d "${ph[@]}"
|
||||
}
|
||||
|
||||
# cygwin doesn't handle symlinks properly, fall back to a proxy mklink
|
||||
if [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
cygwin_ln "${SDKMAN_CANDIDATES_DIR}/${candidate}/current" "${SDKMAN_CANDIDATES_DIR}/${candidate}/${version}"
|
||||
else
|
||||
ln -s "${SDKMAN_CANDIDATES_DIR}/${candidate}/${version}" "${SDKMAN_CANDIDATES_DIR}/${candidate}/current"
|
||||
fi
|
||||
ln -s "${SDKMAN_CANDIDATES_DIR}/${candidate}/${version}" "${SDKMAN_CANDIDATES_DIR}/${candidate}/current"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user