mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts/welcome] don't crash in environments where $SHELL is not present (e.g. Docker containers)
This commit is contained in:
parent
da9646e8a3
commit
4bd272f165
1 changed files with 4 additions and 2 deletions
|
@ -42,7 +42,9 @@ def get_system_info():
|
|||
if users_info:
|
||||
info("Users", users_info)
|
||||
|
||||
info("Shell", _get_shell())
|
||||
shell = _get_shell()
|
||||
if shell is not None:
|
||||
info("Shell", shell)
|
||||
|
||||
info_lines.append("")
|
||||
|
||||
|
@ -101,7 +103,7 @@ def _get_users():
|
|||
|
||||
|
||||
def _get_shell():
|
||||
return os.environ["SHELL"]
|
||||
return os.environ.get("SHELL")
|
||||
|
||||
|
||||
def _get_cpu_usage():
|
||||
|
|
Loading…
Reference in a new issue