Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
0e12ebb4
Commit
0e12ebb4
authored
Jun 02, 2020
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init: use grep for zcompdump metadata check
Closes #8981
parent
93cc3964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
oh-my-zsh.sh
oh-my-zsh.sh
+11
-7
No files found.
oh-my-zsh.sh
View file @
0e12ebb4
...
...
@@ -62,13 +62,13 @@ if [ -z "$ZSH_COMPDUMP" ]; then
fi
# Construct zcompdump OMZ metadata
zcompdump_metadata
=
"
\
#omz revision:
$(
builtin cd
-q
"
$ZSH
"
;
git rev-parse HEAD 2>/dev/null
)
#omz fpath:
$fpath
\
"
zcompdump_revision
=
"#omz revision:
$(
builtin cd
-q
"
$ZSH
"
;
git rev-parse HEAD 2>/dev/null
)
"
zcompdump_fpath
=
"#omz fpath:
$fpath
"
# Delete the zcompdump file if OMZ zcompdump metadata changed
if
!
cmp
-s
<
(
command grep
'^#omz'
"
$ZSH_COMPDUMP
"
2>/dev/null
)
<
(
echo
"
$zcompdump_metadata
"
)
;
then
if
!
command grep
-q
-Fx
"
$zcompdump_revision
"
"
$ZSH_COMPDUMP
"
2>/dev/null
\
||
!
command grep
-q
-Fx
"
$zcompdump_fpath
"
"
$ZSH_COMPDUMP
"
2>/dev/null
;
then
echo
zcompdump changed
command rm
-f
"
$ZSH_COMPDUMP
"
zcompdump_refresh
=
1
fi
...
...
@@ -86,10 +86,14 @@ fi
# Append zcompdump metadata if missing
if
((
$zcompdump_refresh
))
;
then
echo
"
\n
$zcompdump_metadata
"
|
tee
-a
"
$ZSH_COMPDUMP
"
&>/dev/null
cat
>>
|
"
$ZSH_COMPDUMP
"
<<
EOF
$zcompdump_revision
$zcompdump_fpath
EOF
fi
unset
zcompdump_
metadata
zcompdump_refresh
unset
zcompdump_
revision zcompdump_fpath
zcompdump_refresh
# Load all of the config files in ~/oh-my-zsh that end in .zsh
...
...
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