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
278bcfc9
Unverified
Commit
278bcfc9
authored
Oct 02, 2023
by
Thomas Faugier
Committed by
Carlo Sala
Oct 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(asdf): load zsh completions instead of bash ones
Closes #11143 Closes #8779 Co-authored-by:
Carlo Sala
<
carlosalag@protonmail.com
>
parent
27402e26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
asdf.plugin.zsh
plugins/asdf/asdf.plugin.zsh
+17
-14
No files found.
plugins/asdf/asdf.plugin.zsh
View file @
278bcfc9
...
...
@@ -2,26 +2,29 @@
ASDF_DIR
=
"
${
ASDF_DIR
:-
$HOME
/.asdf
}
"
ASDF_COMPLETIONS
=
"
$ASDF_DIR
/completions"
# If not found, check for archlinux/AUR package (/opt/asdf-vm/)
if
[[
!
-f
"
$ASDF_DIR
/asdf.sh"
||
!
-f
"
$ASDF_COMPLETIONS
/asdf.bash"
]]
&&
[[
-f
"/opt/asdf-vm/asdf.sh"
]]
;
then
if
[[
!
-f
"
$ASDF_DIR
/asdf.sh"
||
!
-f
"
$ASDF_COMPLETIONS
/_asdf"
]]
;
then
# If not found, check for archlinux/AUR package (/opt/asdf-vm/)
if
[[
-f
"/opt/asdf-vm/asdf.sh"
]]
;
then
ASDF_DIR
=
"/opt/asdf-vm"
ASDF_COMPLETIONS
=
"
$ASDF_DIR
"
fi
# If not found, check for Homebrew package
if
[[
!
-f
"
$ASDF_DIR
/asdf.sh"
||
!
-f
"
$ASDF_COMPLETIONS
/asdf.bash"
]]
&&
((
$+
commands[brew]
))
;
then
brew_prefix
=
"
$(
brew
--prefix
asdf
)
"
ASDF_DIR
=
"
${
brew_prefix
}
/libexec"
ASDF_COMPLETIONS
=
"
${
brew_prefix
}
/etc/bash_completion.d"
unset
brew_prefix
# If not found, check for Homebrew package
elif
((
$+
commands[brew]
))
;
then
_ASDF_PREFIX
=
"
$(
brew
--prefix
asdf
)
"
ASDF_DIR
=
"
${
_ASDF_PREFIX
}
/libexec"
ASDF_COMPLETIONS
=
"
${
_ASDF_PREFIX
}
/share/zsh/site-functions"
unset
_ASDF_PREFIX
else
return
fi
fi
# Load command
if
[[
-f
"
$ASDF_DIR
/asdf.sh"
]]
;
then
.
"
$ASDF_DIR
/asdf.sh"
source
"
$ASDF_DIR
/asdf.sh"
# Load completions
if
[[
-f
"
$ASDF_COMPLETIONS
/asdf.bash"
]]
;
then
.
"
$ASDF_COMPLETIONS
/asdf.bash"
if
[[
-f
"
$ASDF_COMPLETIONS
/_asdf"
]]
;
then
fpath+
=(
"
$ASDF_COMPLETIONS
"
)
autoload
-Uz
_asdf
compdef _asdf asdf
# compdef is already loaded before loading plugins
fi
fi
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