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
4fcf52c2
Unverified
Commit
4fcf52c2
authored
Aug 01, 2022
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: don't use `$functions_source` for compatibility with zsh < 5.4
parent
aa75eeea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
36 deletions
+46
-36
aliases.plugin.zsh
plugins/aliases/aliases.plugin.zsh
+13
-10
shell-proxy.plugin.zsh
plugins/shell-proxy/shell-proxy.plugin.zsh
+33
-26
No files found.
plugins/aliases/aliases.plugin.zsh
View file @
4fcf52c2
# with lots of 3rd-party amazing aliases installed, just need something to explore it quickly.
# Handle $0 according to the standard:
#
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
# - acs: alias cheatsheet
0
=
"
${${
ZERO
:-${
0
:#
$ZSH_ARGZERO
}}:-${
(%)
:-
%N
}}
"
# group alias by command, pass addition argv to grep.
0
=
"
${${
(M)0
:#/
*
}:-
$PWD
/
$0
}
"
function
acs
(){
eval
'
function acs(){
(( $+commands[python3] )) || {
(( $+commands[python3] )) || {
echo "[error] No python executable detected"
echo "[error] No python executable detected"
return
return
}
}
alias
| python3
${
functions_source
[
$0
]
:h
}
/cheatsheet.py
$@
alias | python3 "'
"
${
0
:h
}
"
'/cheatsheet.py" "$@"
}
}
'
plugins/shell-proxy/shell-proxy.plugin.zsh
View file @
4fcf52c2
#!/usr/bin/bash
#!/usr/bin/bash
# shellcheck disable=SC1090,SC2154
# shellcheck disable=SC1090,SC2154
proxy
()
{
# Handle $0 according to the standard:
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
0
=
"
${${
ZERO
:-${
0
:#
$ZSH_ARGZERO
}}:-${
(%)
:-
%N
}}
"
0
=
"
${${
(M)0
:#/
*
}:-
$PWD
/
$0
}
"
eval
'
proxy() {
# deprecate $DEFAULT_PROXY, use SHELLPROXY_URL instead
# deprecate $DEFAULT_PROXY, use SHELLPROXY_URL instead
if [[ -n "$DEFAULT_PROXY" && -z "$SHELLPROXY_URL" ]]; then
if [[ -n "$DEFAULT_PROXY" && -z "$SHELLPROXY_URL" ]]; then
echo >&2 "proxy: DEFAULT_PROXY is deprecated, use SHELLPROXY_URL instead"
echo >&2 "proxy: DEFAULT_PROXY is deprecated, use SHELLPROXY_URL instead"
...
@@ -17,7 +23,7 @@ proxy() {
...
@@ -17,7 +23,7 @@ proxy() {
fi
fi
# the proxy.py script is in the same directory as this function
# the proxy.py script is in the same directory as this function
local
proxy
=
"
${
functions_source
[
$0
]
:A:h
}
/proxy.py"
local proxy="'
"
${
0
:h
}
"
'
/proxy.py"
# capture the output of the proxy script and bail out if it fails
# capture the output of the proxy script and bail out if it fails
local output
local output
...
@@ -26,7 +32,8 @@ proxy() {
...
@@ -26,7 +32,8 @@ proxy() {
# evaluate the output generated by the proxy script
# evaluate the output generated by the proxy script
source <(echo "$output")
source <(echo "$output")
}
}
'
_proxy
()
{
_proxy
()
{
local
-r
commands
=(
'enable'
'disable'
'status'
)
local
-r
commands
=(
'enable'
'disable'
'status'
)
...
...
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