From: Richard Hartmann Date: Sun, 29 Nov 2015 12:33:45 +0000 (+0100) Subject: vcsh: Fix regression introduced in d946b07817ffe6e X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/9cf8f5c46b230abd912657aeac276e4a2ce38ce0?ds=sidebyside;hp=-c vcsh: Fix regression introduced in d946b07817ffe6e github: Closes richih/vcsh#168 --- 9cf8f5c46b230abd912657aeac276e4a2ce38ce0 diff --git a/vcsh b/vcsh index 8bfafab..ff256da 100755 --- a/vcsh +++ b/vcsh @@ -425,12 +425,16 @@ use() { } which() { - [ -e "$VCSH_COMMAND_PARAMETER" ] || fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 - for VCSH_REPO_NAME in $(list); do + output=$(for VCSH_REPO_NAME in $(list); do for VCSH_FILE in $(get_files); do echo "$VCSH_FILE" | grep -q "$VCSH_COMMAND_PARAMETER" && echo "$VCSH_REPO_NAME: $VCSH_FILE" done - done | sort -u + done | sort -u) + if [ -z "$output" ]; then + fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 + else + echo "$output" + fi } write_gitignore() {