Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
bca720fa
Commit
bca720fa
authored
Jul 09, 2015
by
Andrew Janke
Browse files
diagnostics: include detailed OS version info if possible
parent
9813ff5f
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/diagnostics.zsh
View file @
bca720fa
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment