Skip to content

Commit 7164c09

Browse files
Amada MackeyAndy-Python-Programmer
Amada Mackey
authored andcommitted
Preserve result of package search after SIGPIPE redirect
1 parent eea7694 commit 7164c09

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ for pkg in "${packages[@]}"; do
4646
else
4747
install_package $pkg &>/dev/null
4848
fi
49-
49+
5050
if query_package $pkg; then
5151
echo -e "${GREEN}ok${NC}"
5252
else

tools/deps/deps_darwin

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ packages=(
4747
)
4848

4949
function install_package() { brew install $1; }
50-
function query_package() { brew list | { grep -q $1; cat > /dev/null;} }
50+
function query_package() {
51+
brew list | {
52+
RESULT=$(grep -q $1);
53+
cat > /dev/null;
54+
return $RESULT;
55+
}
56+
}

0 commit comments

Comments
 (0)