Merge pull request #4217 from apjanke/missing-pwd-concise-error

brew: Conciser error when run from nonexistent directory
This commit is contained in:
Mike McQuaid 2018-05-28 20:32:05 +01:00 committed by GitHub
commit 6cb86da614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,12 @@
#!/bin/bash
set +o posix
# Fail fast with concise message when cwd does not exist
if ! [[ -d "$PWD" ]]; then
echo "Error: The current working directory doesn't exist, cannot proceed." >&2
exit 1
fi
quiet_cd() {
cd "$@" >/dev/null
}