Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Commit

Permalink
Use $PCTL_PROXY_ADDRESS and $PCTL_PROXY_PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
ytet5uy4 committed Jun 21, 2017
1 parent 6b5d47a commit 76caa82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ zplug 'ytet5uy4/pctl'

## Configuration

Add the following to your `.zshrc`:
Add the following to your `.zshenv`:

```zsh
export PROXY_ADDRESS=proxy.example.com PORT=8080
export PCTL_PROXY_ADDRESS=proxy.example.com PCTL_PROXY_PORT=8080
```

To keep the environment variables of proxy when using `sudo`,
Expand Down
10 changes: 5 additions & 5 deletions autoload/pctl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ main() {
cprintf 'error\n' $color[error]
printf ' Environment variable has already set.\n\n'
return 1
elif [[ -z $PROXY_ADDRESS ]] || [[ -z $PROXY_PORT ]]; then
elif [[ -z $PCTL_PROXY_ADDRESS ]] || [[ -z $PCTL_PROXY_PORT ]]; then
cprintf 'error\n' $color[error]
printf ' Not set `$PROXY_ADDRESS` or `$PROXY_PORT`.\n'
printf ' $ export PROXY_ADDRESS=proxy.example.com PROXY_PORT=8080\n\n'
printf ' Not set `$PCTL_PROXY_ADDRESS` or `$PCTL_PROXY_PORT`.\n'
printf ' $ export PCTL_PROXY_ADDRESS=proxy.example.com PCTL_PROXY_PORT=8080\n\n'
return 1
fi
export http_proxy="http://$PROXY_ADDRESS:$PROXY_PORT"
export https_proxy="http://$PROXY_ADDRESS:$PROXY_PORT"
export http_proxy="http://$PCTL_PROXY_ADDRESS:$PCTL_PROXY_PORT"
export https_proxy="http://$PCTL_PROXY_ADDRESS:$PCTL_PROXY_PORT"
cprintf 'done\n\n' $color[success]
;;
-u | --unset )
Expand Down

0 comments on commit 76caa82

Please sign in to comment.