Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

4 changed files with 16 additions and 31 deletions

View File

@ -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/)
## 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:
```Bash
$ poetry build
$ pip install dist/nvexpo*.whl
```
## Preparation
Add the following line to your `.bashrc` file:
And add the follow line to your `.bashrc` file:
```Bash
eval "$(nvexpo init bash)"
```

View File

@ -3,8 +3,8 @@
import re
import sys
from nvexpo import consts as CONSTS
from nvexpo import nvexpo
from nvexpo import consts as CONSTS
def main() -> int:
@ -17,6 +17,10 @@ def main() -> int:
nvexpo.unset_env(args[2:])
return 0
if args[1] in ["--load"]:
nvexpo._load()
return 0
if args[1] in ["init"]:
try:
nvexpo.init(args[2])
@ -28,7 +32,7 @@ def main() -> int:
variables = {}
for raw_var in raw_vars:
if "=" not in raw_var:
nvexpo.show_help('Use the syntax "key=value"')
nvexpo.show_help("Use the syntax \"key=value\"")
return 1
try:
key, value = raw_var.split("=", 1)
@ -45,7 +49,7 @@ def main() -> int:
nvexpo.show_help("Empty value")
return 1
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
nvexpo.set_env(variables)
return 0

View File

@ -1,12 +1,9 @@
[tool.poetry]
name = "nvexpo"
version = "0.1.1"
version = "0.1.0"
description = ""
authors = ["kirbylife <kirbylife@protonmail.com>"]
readme = "README.md"
license = "MIT"
repository = "https://git.kirbylife.dev/kirbylife/nvexpo"
keywords = ["cli", "bash", "export", "env var"]
[tool.poetry.dependencies]
python = "^3.8"
@ -23,10 +20,11 @@ format = "ruff format nvexpo"
linter = "ruff nvexpo"
typing = "mypy nvexpo"
[tool.ruff]
target-version = "py38"
line-length = 120
indent-width = 4
line-length=120
indent-width=4
[tool.ruff.lint]
select = ["ALL"]
@ -41,11 +39,7 @@ ignore = [
"PLR2004",
"FA102",
"PLW2901",
"N812",
"C901",
"PLR0912",
"D213",
"D211"
"N812"
]
fixable = ["ALL"]

1
test.env 100644
View File

@ -0,0 +1 @@
HELLO=10