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
5c9a3d2f
Commit
5c9a3d2f
authored
Feb 01, 2023
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(installer): don't use `$ZDOTDIR` in zshrc file if same as `$HOME`
Fixes #11471
parent
27f31799
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
install.sh
tools/install.sh
+5
-3
No files found.
tools/install.sh
View file @
5c9a3d2f
...
@@ -61,9 +61,9 @@ custom_zsh=${ZSH:+yes}
...
@@ -61,9 +61,9 @@ custom_zsh=${ZSH:+yes}
zdot
=
"
${
ZDOTDIR
:-
$HOME
}
"
zdot
=
"
${
ZDOTDIR
:-
$HOME
}
"
# Default value for $ZSH
# Default value for $ZSH
# a) if $ZDOTDIR is supplied: $ZDOTDIR/ohmyzsh
# a) if $ZDOTDIR is supplied
and not $HOME
: $ZDOTDIR/ohmyzsh
# b) otherwise, $HOME/.oh-my-zsh
# b) otherwise, $HOME/.oh-my-zsh
ZSH
=
"
${
ZSH
:-${
ZDOTDIR
:+
$ZDOTDIR
/ohmyzsh
}}
"
[
"
$ZDOTDIR
"
=
"
$HOME
"
]
||
ZSH
=
"
${
ZSH
:-${
ZDOTDIR
:+
$ZDOTDIR
/ohmyzsh
}}
"
ZSH
=
"
${
ZSH
:-
$HOME
/.oh-my-zsh
}
"
ZSH
=
"
${
ZSH
:-
$HOME
/.oh-my-zsh
}
"
# Default settings
# Default settings
...
@@ -350,7 +350,9 @@ setup_zshrc() {
...
@@ -350,7 +350,9 @@ setup_zshrc() {
# Modify $ZSH variable in .zshrc directory to use the literal $ZDOTDIR or $HOME
# Modify $ZSH variable in .zshrc directory to use the literal $ZDOTDIR or $HOME
omz
=
"
$ZSH
"
omz
=
"
$ZSH
"
[
-z
"
$ZDOTDIR
"
]
||
omz
=
$(
echo
"
$omz
"
|
sed
"s|^
$ZDOTDIR
/|
\$
ZDOTDIR/|"
)
if
[
-n
"
$ZDOTDIR
"
]
&&
[
"
$ZDOTDIR
"
!=
"
$HOME
"
]
;
then
omz
=
$(
echo
"
$omz
"
|
sed
"s|^
$ZDOTDIR
/|
\$
ZDOTDIR/|"
)
fi
omz
=
$(
echo
"
$omz
"
|
sed
"s|^
$HOME
/|
\$
HOME/|"
)
omz
=
$(
echo
"
$omz
"
|
sed
"s|^
$HOME
/|
\$
HOME/|"
)
sed
"s|^export ZSH=.*
$|
export ZSH=
\"
${
omz
}
\"
|"
"
$ZSH
/templates/zshrc.zsh-template"
>
"
$zdot
/.zshrc-omztemp"
sed
"s|^export ZSH=.*
$|
export ZSH=
\"
${
omz
}
\"
|"
"
$ZSH
/templates/zshrc.zsh-template"
>
"
$zdot
/.zshrc-omztemp"
...
...
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