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
2e487b18
Unverified
Commit
2e487b18
authored
Apr 06, 2021
by
Septs
Committed by
GitHub
Apr 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(shell-proxy): enable unexported `DEFAULT_PROXY` setting (#9774)
parent
790f185e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
proxy.py
plugins/shell-proxy/proxy.py
+3
-2
shell-proxy.plugin.zsh
plugins/shell-proxy/shell-proxy.plugin.zsh
+1
-1
No files found.
plugins/shell-proxy/proxy.py
View file @
2e487b18
...
@@ -9,8 +9,9 @@ user_proxy = os.environ.get("CONFIG_PROXY", os.path.expandvars("$HOME/.config/pr
...
@@ -9,8 +9,9 @@ user_proxy = os.environ.get("CONFIG_PROXY", os.path.expandvars("$HOME/.config/pr
def
get_http_proxy
():
def
get_http_proxy
():
if
"DEFAULT_PROXY"
in
os
.
environ
:
default_proxy
=
os
.
environ
.
get
(
"DEFAULT_PROXY"
)
return
os
.
environ
[
"DEFAULT_PROXY"
]
if
default_proxy
:
return
default_proxy
if
os
.
path
.
isfile
(
user_proxy
):
if
os
.
path
.
isfile
(
user_proxy
):
return
check_output
(
user_proxy
)
.
decode
(
"utf-8"
)
.
strip
()
return
check_output
(
user_proxy
)
.
decode
(
"utf-8"
)
.
strip
()
raise
Exception
(
"Not found, Proxy configuration"
)
raise
Exception
(
"Not found, Proxy configuration"
)
...
...
plugins/shell-proxy/shell-proxy.plugin.zsh
View file @
2e487b18
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
__PROXY__
=
"
${
0
:A:h
}
/proxy.py"
__PROXY__
=
"
${
0
:A:h
}
/proxy.py"
proxy
()
{
proxy
()
{
source
<
(
"
$__PROXY__
"
"
$1
"
)
source
<
(
env
"DEFAULT_PROXY=
$DEFAULT_PROXY
"
"
$__PROXY__
"
"
$1
"
)
}
}
_proxy
()
{
_proxy
()
{
...
...
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