Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
4f0b6802
Unverified
Commit
4f0b6802
authored
Mar 07, 2022
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(installer): fix `$HOME` setting if `getent` is not found (macOS)
Related:
https://github.com/ohmyzsh/ohmyzsh/pull/10713/files#r820219899
parent
9350e1ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
install.sh
tools/install.sh
+3
-1
No files found.
tools/install.sh
View file @
4f0b6802
...
@@ -45,7 +45,9 @@ USER=${USER:-$(id -u -n)}
...
@@ -45,7 +45,9 @@ USER=${USER:-$(id -u -n)}
# $HOME is defined at the time of login, but it could be unset. If it is unset,
# $HOME is defined at the time of login, but it could be unset. If it is unset,
# a tilde by itself (~) will not be expanded to the current user's home directory.
# a tilde by itself (~) will not be expanded to the current user's home directory.
# POSIX: https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap08.html#tag_08_03
# POSIX: https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap08.html#tag_08_03
HOME
=
"
${
HOME
:-$(
getent passwd
$USER
|
cut
-d
:
-f6
)}
"
HOME
=
"
${
HOME
:-$(
getent passwd
$USER
2>/dev/null |
cut
-d
:
-f6
)}
"
# macOS does not have getent, but this works even if $HOME is unset
HOME
=
"
${
HOME
:-$(
eval echo
~
$USER
)}
"
# Track if $ZSH was provided
# Track if $ZSH was provided
...
...
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