aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-13 21:37:15 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-13 21:37:15 +0300
commit02528905501aaef52941b57e9074b006c7ae7843 (patch)
tree4fbf0313f0d7e60794373e390a75c7e879c80f7c
parentadd ghci.conf (diff)
downloadlinux-home-02528905501aaef52941b57e9074b006c7ae7843.tar.gz
linux-home-02528905501aaef52941b57e9074b006c7ae7843.zip
add ensure_symlinks_enabled
-rw-r--r--.bashrc20
1 files changed, 19 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index b359b24..bffe09f 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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