Skip to content

Commit

Permalink
fix: improve matching of mi targets
Browse files Browse the repository at this point in the history
eg dont match undebugcss when looking for debugcss target
  • Loading branch information
cerico committed Jul 30, 2023
1 parent f52f583 commit 98d81c0
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 @@ -298,7 +298,7 @@ mi () { # List all Makefile targets or get info in target # ➜ mi start
if [[ -n $1 ]]
then
local command=$1
local output=$(awk -v cmd="$command" '/^.*:$/{p=0} $0 ~ cmd ".*:"{p=1} p; /^\t/{p=0}' Makefile)
local output=$(awk -v cmd="$command" '$1 == cmd ":" {p=1} p; /^\t/{p=0}' Makefile)
[[ -n "$output" ]] && echo "$output" || echo "Target not found. Add with ➜ addtomake $command"
else
echo "Available commands:"
Expand Down

0 comments on commit 98d81c0

Please sign in to comment.