Skip to content

Commit

Permalink
fix: use grep -q instead of pipe dev null
Browse files Browse the repository at this point in the history
- improve syntax in command not found handler
  • Loading branch information
cerico committed Jun 7, 2024
1 parent 14cedb6 commit d305555
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/zsh/main.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export MARKPATH=$HOME/.marks
alias sedi='sed -i "" -e'

command_not_found_handler () {
if [ -f Makefile ] && grep "^$1:" Makefile > /dev/null; then
if [ -f Makefile ] && grep -q "^$1:" Makefile; then
local rule=$(echo $1 | awk -F ":" '{print $1}')
make $rule
return 0
Expand Down

0 comments on commit d305555

Please sign in to comment.