We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 99a9e95 + 6305ae3 commit c29730cCopy full SHA for c29730c
xr.sh
@@ -2,7 +2,17 @@
2
3
# Constants.
4
_exo_config=".exercism/metadata.json"
5
-_dir="$(dirname "$(readlink -f "$0")")"
+
6
+# Finding the location of the sourced script is shell-specific
7
+# Currently, zsh and bash are the only supported shells
8
+if [ -n "$ZSH_VERSION" ]; then
9
+ _dir="$(dirname "$(readlink -f "$0")")"
10
+elif [ -n "$BASH_VERSION" ]; then
11
+ _dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
12
+else
13
+ echo "This is an unsupported shell." >&2
14
+ return 1
15
+fi
16
17
read -r -d '' _short_doc << EOF
18
Usage: xr [<command>] [<uuid>]
0 commit comments