Revert "Fix creating symlinks in cygwin (#302)" (#468)

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:
Scott Busche
2016-09-08 11:40:31 -05:00
committed by Marco Vermeulen
parent 29a7f4cca5
commit abc19ee1d0

View File

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