diff --git a/developer/bin/project_stats b/developer/bin/project_stats index ae97e103c1..767e8e0d13 100755 --- a/developer/bin/project_stats +++ b/developer/bin/project_stats @@ -26,7 +26,7 @@ warn_if_off_branch () { if [[ -n "$1" ]]; then wanted_branch="$1" fi - if [[ "$branch" != "$wanted_branch" ]]; then + if ! [[ "$branch" = "$wanted_branch" ]]; then printf "\nWARNING: you are running from branch '$branch', not '$wanted_branch'\n\n" fi } @@ -60,7 +60,7 @@ _homebrew_cask_project_stats () { verify_git_object "$start_object" printf "Unique contributors" - if [[ "$start_object" != "$initial_commit" ]]; then + if ! [[ "$start_object" = "$initial_commit" ]]; then printf " since $start_object" fi printf "\n" @@ -75,7 +75,7 @@ _homebrew_cask_project_stats () { $git_log_cmd -- $doc_paths | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l printf " any\t" $git_log_cmd -- . | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l - if [[ "$start_object" != "$initial_commit" ]]; then + if ! [[ "$start_object" = "$initial_commit" ]]; then local alltime_contribs="$(git log --no-merges --format='%ae' ${initial_commit}..${end_object} -- . | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l)" local prior_contribs="$(git log --no-merges --format='%ae' ${initial_commit}..${start_object} -- . | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l)" # arithmetic removes whitespace @@ -87,7 +87,7 @@ _homebrew_cask_project_stats () { printf "\n" - if [[ "$start_object" != "$initial_commit" ]]; then + if ! [[ "$start_object" = "$initial_commit" ]]; then local new_casks="$(git diff --name-status "$start_object" "$end_object" -- $cask_paths | /usr/bin/grep '^A.*\.rb' | cut -f2 | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l)" local deleted_casks="$(git diff --name-status "$start_object" "$end_object" -- $cask_paths | /usr/bin/grep '^D.*\.rb' | cut -f2 | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l)" local updated_casks="$(git diff --name-status "$start_object" "$end_object" -- $cask_paths | /usr/bin/grep '^M.*\.rb' | cut -f2 | /usr/bin/sort | /usr/bin/uniq | /usr/bin/wc -l)"