aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.bashrc_third_party
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.bashrc_third_party22
1 files changed, 12 insertions, 10 deletions
diff --git a/.bashrc_third_party b/.bashrc_third_party
index cddbb6c..6d1e28c 100644
--- a/.bashrc_third_party
+++ b/.bashrc_third_party
@@ -1,28 +1,30 @@
-[ ! -z "${BASHRC_THIRD_PARTY+x}" ] && return || readonly BASHRC_THIRD_PARTY=1
+#!/usr/bin/env bash
-ensure_symlinks_enabled() {
- [ -z "${CYGWIN+x}" ] && return 1
+if [ -n "${BASHRC_THIRD_PARTY+x}" ]; then
+ return 0
+else
+ readonly BASHRC_THIRD_PARTY=1
+fi
- case "$CYGWIN" in
+ensure_symlinks_enabled() {
+ case "${CYGWIN:-}" in
*winsymlinks:native*) ;;
*winsymlinks:nativestrict*) ;;
*)
+ echo "${FUNCNAME[0]}: native Windows symlinks aren't enabled in Cygwin" >&2
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
+ ensure_symlinks_enabled
+
if [ "$#" -ne 2 ]; then
- echo "usage: $FUNCNAME SRC_DIR DEST_DIR" >&2
+ echo "usage: ${FUNCNAME[0]} SRC_DIR DEST_DIR" >&2
return 1
fi