diff options
author | Andrew Janke <andrew@apjanke.net> | 2015-07-09 20:50:57 -0400 |
---|---|---|
committer | Andrew Janke <andrew@apjanke.net> | 2015-07-09 21:18:11 -0400 |
commit | bca720fa9549f7fe4687acd1aaf91720428657e9 (patch) | |
tree | 97bf1bad0fecc8cdf461b3c9665791e7db0e6029 /lib | |
parent | 9813ff5f24c6ce8409490d7ef8b8c4458f2a6a66 (diff) | |
download | zsh-bca720fa9549f7fe4687acd1aaf91720428657e9.tar.gz zsh-bca720fa9549f7fe4687acd1aaf91720428657e9.tar.bz2 zsh-bca720fa9549f7fe4687acd1aaf91720428657e9.zip |
diagnostics: include detailed OS version info if possible
Diffstat (limited to 'lib')
-rw-r--r-- | lib/diagnostics.zsh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh index f5f15deaa..53c6548de 100644 --- a/lib/diagnostics.zsh +++ b/lib/diagnostics.zsh @@ -55,6 +55,8 @@ function omz_diagnostic_dump() { emulate -L zsh + builtin echo "Generating diagnostic dump; please be patient..." + local thisfcn=omz_diagnostic_dump local -A opts local opt_verbose opt_noverbose opt_outfile @@ -108,6 +110,8 @@ function _omz_diag_dump_one_big_text() { builtin echo User: $USER builtin echo umask: $(umask) builtin echo + _omz_diag_dump_os_specific_version + builtin echo # Installed programs programs=(sh zsh ksh bash sed cat grep ls find git posh) @@ -299,4 +303,28 @@ function _omz_diag_dump_echo_file_w_header() { fi } +function _omz_diag_dump_os_specific_version() { + local osname osver version_file version_files + case "$OSTYPE" in + darwin*) + osname=$(command sw_vers -productName) + osver=$(command sw_vers -productVersion) + builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)" + ;; + cygwin) + command systeminfo | command grep "^OS Name\|^OS Version" + ;; + esac + + if builtin which lsb_release >/dev/null; then + builtin echo "OS Release: $(command lsb_release -s -d)" + fi + + version_files=( /etc/*-release(N) /etc/*-version(N) /etc/*_version(N) ) + for version_file in $version_files; do + builtin echo "$version_file:" + command cat "$version_file" + builtin echo + done +} |