diff options
author | Andrew Janke <andrew@apjanke.net> | 2015-09-04 14:13:00 -0400 |
---|---|---|
committer | Andrew Janke <andrew@apjanke.net> | 2015-09-04 14:13:00 -0400 |
commit | 46ddd88fe056ee84064536ce9b34f86bba6b53ca (patch) | |
tree | 6d34ae618f08e92e6def4f7e5c7d8ba2ae9916e6 /lib | |
parent | fa254458688acf0bede8567b2bb5793a9ed944d6 (diff) | |
download | zsh-46ddd88fe056ee84064536ce9b34f86bba6b53ca.tar.gz zsh-46ddd88fe056ee84064536ce9b34f86bba6b53ca.tar.bz2 zsh-46ddd88fe056ee84064536ce9b34f86bba6b53ca.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/diagnostics.zsh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh index f38239110..afc33829b 100644 --- a/lib/diagnostics.zsh +++ b/lib/diagnostics.zsh @@ -117,13 +117,16 @@ function _omz_diag_dump_one_big_text() { # Installed programs programs=(sh zsh ksh bash sed cat grep ls find git posh) + local progfile="" extra_str="" sha_str="" for program in $programs; do - local md5_str="" md5="" link_str="" extra_str="" + extra_str="" sha_str="" progfile=$(builtin which $program) if [[ $? == 0 ]]; then if [[ -e $progfile ]]; then - if builtin whence md5 &>/dev/null; then - extra_str+=" $(md5 -q $progfile)" + if builtin whence shasum &>/dev/null; then + sha_str=($(command shasum $progfile)) + sha_str=$sha_str[1] + extra_str+=" SHA $sha_str" fi if [[ -h "$progfile" ]]; then extra_str+=" ( -> ${progfile:A} )" @@ -314,7 +317,7 @@ function _omz_diag_dump_os_specific_version() { builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)" ;; cygwin) - command systeminfo | command grep "^OS Name\|^OS Version" + command systeminfo | command head -4 | command tail -2 ;; esac |