mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-06 12:15:39 +00:00
Use type instead of which in shell scripts
The latter is not a Bash built-in, and some environments turn out to produce non-conforming return codes. `type` is provided by Bash itself, so we can rely on it better.
This commit is contained in:
1 parent
f0161b41c8
commit
fa22b78e7d
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ trap "cd; rm -rf ${tmpdir@Q}" EXIT
|
||||
src="$PWD"
|
||||
cd "$tmpdir" || exit
|
||||
|
||||
if which cygpath &>/dev/null; then
|
||||
if type -t cygpath >/dev/null; then
|
||||
# MinGW needs the Windows path substituted but with forward slash separators;
|
||||
# Cygwin has `cygpath` but just needs the original path substituted.
|
||||
subst1="$(printf '%s\n' "$src" | sed 's:[][\/.^$*]:\\&:g')"
|
||||
|
||||
Reference in new issue
Block a user