diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-13 21:37:15 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-13 21:37:15 +0300 |
commit | 02528905501aaef52941b57e9074b006c7ae7843 (patch) | |
tree | 4fbf0313f0d7e60794373e390a75c7e879c80f7c | |
parent | add ghci.conf (diff) | |
download | linux-home-02528905501aaef52941b57e9074b006c7ae7843.tar.gz linux-home-02528905501aaef52941b57e9074b006c7ae7843.zip |
add ensure_symlinks_enabled
-rw-r--r-- | .bashrc | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -209,11 +209,29 @@ nwx_host=172.28.10.2 nwx_dev2=172.28.19.60 nwx_dev3=172.28.19.61 +ensure_symlinks_enabled() { + [ -z "${CYGWIN+x}" ] && return 1 + + case "$CYGWIN" in + *winsymlinks:native*) ;; + *winsymlinks:nativestrict*) ;; + + *) + return 1 + ;; + esac +} + symlink_preferences() ( + if ! ensure_symlinks_enabled; then + echo "$FUNCNAME: it seems like native Windows symlinks aren't enabled in Cygwin." >&2 + return 1 + fi + set -o errexit if [ "$#" -ne 2 ]; then - echo "Usage: $FUNCNAME SRC_DIR DEST_DIR" >&2 + echo "$FUNCNAME: usage: $FUNCNAME SRC_DIR DEST_DIR" >&2 return 1 fi |