Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hellojukay/with-env
给命令注入环境变量, 支持 Darwin, Linux, Windows 系统,命令行科学上网 ?
https://github.com/hellojukay/with-env
Last synced: 16 days ago
JSON representation
给命令注入环境变量, 支持 Darwin, Linux, Windows 系统,命令行科学上网 ?
- Host: GitHub
- URL: https://github.com/hellojukay/with-env
- Owner: hellojukay
- License: bsd-3-clause
- Created: 2022-03-08T02:00:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T13:35:14.000Z (over 1 year ago)
- Last Synced: 2024-10-21T23:33:56.945Z (22 days ago)
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 30
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# with-env
[![check](https://github.com/hellojukay/with-env/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/hellojukay/with-env/actions/workflows/go.yml)通过 .env 文件给命令注入环境变量, 会覆盖系统自带的环境变量。
1. ~/.env
2. .env将下面文件写入到 `.env` 或者 `~/.env` 中,然后执行 `with-env wget` , `wget` 命令就被注入了代理。
```
https_proxy=http://127.0.0.1:7890
http_proxy=http://127.0.0.1:7890
no_proxy=localhost,127.0.0.1HTTPS_PROXY=http://127.0.0.1:7890
HTTP_PROXY=http://127.0.0.1:7890
NO_PROXY=localhost,127.0.0.1
```
使用方式
```
with-env curl ....
with-env wget ....
with-env git clone ...
````# Install
```
go install github.com/hellojukay/with-env@latest
```# Download
[https://github.com/hellojukay/with-env/releases](https://github.com/hellojukay/with-env/releases)