mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew: Conciser error when run from nonexistent directory
This commit is contained in:
parent
e4c02fafda
commit
00e21bfdf7
6
bin/brew
6
bin/brew
@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set +o posix
|
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() {
|
quiet_cd() {
|
||||||
cd "$@" >/dev/null
|
cd "$@" >/dev/null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user