Compare commits
No commits in common. "main" and "v0.1.0" have entirely different histories.
16
README.md
16
README.md
|
@ -14,27 +14,13 @@ nxexpo it's a simple tool to define environment variables on-the-fly and persist
|
||||||
- [MyPy](https://www.mypy-lang.org/)
|
- [MyPy](https://www.mypy-lang.org/)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Installation trough PyPI
|
|
||||||
To install the latest stable version follow the commands:
|
|
||||||
```Bash
|
|
||||||
$ pip install nvexpo --user
|
|
||||||
```
|
|
||||||
You can also use [pipx](https://pypa.github.io/pipx/) to install it:
|
|
||||||
```Bash
|
|
||||||
$ pipx install nvexpo
|
|
||||||
```
|
|
||||||
|
|
||||||
### From the source
|
|
||||||
To install from the source follow the commands:
|
To install from the source follow the commands:
|
||||||
```Bash
|
```Bash
|
||||||
$ poetry build
|
$ poetry build
|
||||||
$ pip install dist/nvexpo*.whl
|
$ pip install dist/nvexpo*.whl
|
||||||
```
|
```
|
||||||
|
|
||||||
## Preparation
|
And add the follow line to your `.bashrc` file:
|
||||||
|
|
||||||
Add the following line to your `.bashrc` file:
|
|
||||||
```Bash
|
```Bash
|
||||||
eval "$(nvexpo init bash)"
|
eval "$(nvexpo init bash)"
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from nvexpo import consts as CONSTS
|
|
||||||
from nvexpo import nvexpo
|
from nvexpo import nvexpo
|
||||||
|
from nvexpo import consts as CONSTS
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
|
@ -17,6 +17,10 @@ def main() -> int:
|
||||||
nvexpo.unset_env(args[2:])
|
nvexpo.unset_env(args[2:])
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if args[1] in ["--load"]:
|
||||||
|
nvexpo._load()
|
||||||
|
return 0
|
||||||
|
|
||||||
if args[1] in ["init"]:
|
if args[1] in ["init"]:
|
||||||
try:
|
try:
|
||||||
nvexpo.init(args[2])
|
nvexpo.init(args[2])
|
||||||
|
@ -28,7 +32,7 @@ def main() -> int:
|
||||||
variables = {}
|
variables = {}
|
||||||
for raw_var in raw_vars:
|
for raw_var in raw_vars:
|
||||||
if "=" not in raw_var:
|
if "=" not in raw_var:
|
||||||
nvexpo.show_help('Use the syntax "key=value"')
|
nvexpo.show_help("Use the syntax \"key=value\"")
|
||||||
return 1
|
return 1
|
||||||
try:
|
try:
|
||||||
key, value = raw_var.split("=", 1)
|
key, value = raw_var.split("=", 1)
|
||||||
|
@ -45,7 +49,7 @@ def main() -> int:
|
||||||
nvexpo.show_help("Empty value")
|
nvexpo.show_help("Empty value")
|
||||||
return 1
|
return 1
|
||||||
if not re.match(CONSTS.VARNAME_PATTERN, key):
|
if not re.match(CONSTS.VARNAME_PATTERN, key):
|
||||||
nvexpo.show_help(f'"{key}" is not a valid name')
|
nvexpo.show_help(f"\"{key}\" is not a valid name")
|
||||||
return 1
|
return 1
|
||||||
nvexpo.set_env(variables)
|
nvexpo.set_env(variables)
|
||||||
return 0
|
return 0
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "nvexpo"
|
name = "nvexpo"
|
||||||
version = "0.1.1"
|
version = "0.1.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["kirbylife <kirbylife@protonmail.com>"]
|
authors = ["kirbylife <kirbylife@protonmail.com>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT"
|
|
||||||
repository = "https://git.kirbylife.dev/kirbylife/nvexpo"
|
|
||||||
keywords = ["cli", "bash", "export", "env var"]
|
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.8"
|
||||||
|
@ -23,6 +20,7 @@ format = "ruff format nvexpo"
|
||||||
linter = "ruff nvexpo"
|
linter = "ruff nvexpo"
|
||||||
typing = "mypy nvexpo"
|
typing = "mypy nvexpo"
|
||||||
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py38"
|
target-version = "py38"
|
||||||
line-length=120
|
line-length=120
|
||||||
|
@ -41,11 +39,7 @@ ignore = [
|
||||||
"PLR2004",
|
"PLR2004",
|
||||||
"FA102",
|
"FA102",
|
||||||
"PLW2901",
|
"PLW2901",
|
||||||
"N812",
|
"N812"
|
||||||
"C901",
|
|
||||||
"PLR0912",
|
|
||||||
"D213",
|
|
||||||
"D211"
|
|
||||||
]
|
]
|
||||||
fixable = ["ALL"]
|
fixable = ["ALL"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue