Compare commits

..

4 Commits
v0.1.0 ... main

Author SHA1 Message Date
kirbylife 48f219be57 Fix small typo 2023-11-06 19:51:31 -06:00
kirbylife d56a253526 Add instructions tu install it trough PyPI 2023-11-06 19:48:35 -06:00
kirbylife 24433d5c23 Improve a little bit the code 2023-11-06 19:43:29 -06:00
kirbylife 13226b9745 Add params to be uploaded to pypi 2023-11-04 00:16:36 -06:00
4 changed files with 31 additions and 16 deletions

View File

@ -14,13 +14,27 @@ 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
```
And add the follow line to your `.bashrc` file:
## Preparation
Add the following line to your `.bashrc` file:
```Bash
eval "$(nvexpo init bash)"
```

View File

@ -3,8 +3,8 @@
import re
import sys
from nvexpo import nvexpo
from nvexpo import consts as CONSTS
from nvexpo import nvexpo
def main() -> int:
@ -17,10 +17,6 @@ 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])
@ -32,7 +28,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)
@ -49,7 +45,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,9 +1,12 @@
[tool.poetry]
name = "nvexpo"
version = "0.1.0"
version = "0.1.1"
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"
@ -20,11 +23,10 @@ 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"]
@ -39,7 +41,11 @@ ignore = [
"PLR2004",
"FA102",
"PLW2901",
"N812"
"N812",
"C901",
"PLR0912",
"D213",
"D211"
]
fixable = ["ALL"]

View File

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