diagnostics: switch to shasum, filter sysinfo using lines
shasum seems more widely available than md5/md5sum, and we don't have to worry about dealing with the different signatures and output formats of md5 and md5sum then.
sysinfo outputs localized message labels, so we can't just grep for "OS Type". But OS is the first thing it outputs, so we can probably just grab those lines by line number. Switched to doing that.
Diff
1diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh
2index f3823911095902e623465ee19453675f84212562..afc33829b01c0a09dc0633a21fbfee906c5d3116 100644
3--- a/lib/diagnostics.zsh
4+++ b/lib/diagnostics.zsh
5@@ -117,13 +117,16 @@ function _omz_diag_dump_one_big_text() {
6 7 # Installed programs
8 programs=(sh zsh ksh bash sed cat grep ls find git posh)
9+ local progfile="" extra_str="" sha_str=""
10 for program in $programs; do
11- local md5_str="" md5="" link_str="" extra_str=""
12+ extra_str="" sha_str=""
13 progfile=$(builtin which $program)
14 if [[ $? == 0 ]]; then
15 if [[ -e $progfile ]]; then
16- if builtin whence md5 &>/dev/null; then
17- extra_str+=" $(md5 -q $progfile)"
18+ if builtin whence shasum &>/dev/null; then
19+ sha_str=($(command shasum $progfile))
20+ sha_str=$sha_str[1]
21+ extra_str+=" SHA $sha_str"
22 fi
23 if [[ -h "$progfile" ]]; then
24 extra_str+=" ( -> ${progfile:A} )"
25@@ -314,7 +317,7 @@ function _omz_diag_dump_os_specific_version() {
26 builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)"
27 ;;
28 cygwin)
29- command systeminfo | command grep "^OS Name\|^OS Version"
30+ command systeminfo | command head -4 | command tail -2
31 ;;
32 esac
33