aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.bashrc_third_party
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-13 23:38:11 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-13 23:38:11 +0200
commit1bc5eea5274881a299da19ff5df1c7ddc61cbe93 (patch)
treede2c6c9c9ae633c50941ffb244ffea91185e21a3 /.bashrc_third_party
parent.ghci: add :hoogle (diff)
downloadlinux-home-1bc5eea5274881a299da19ff5df1c7ddc61cbe93.tar.gz
linux-home-1bc5eea5274881a299da19ff5df1c7ddc61cbe93.zip
fix ShellCheck warnings
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