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

View File

@ -3,8 +3,8 @@
import re import re
import sys import sys
from nvexpo import nvexpo
from nvexpo import consts as CONSTS from nvexpo import consts as CONSTS
from nvexpo import nvexpo
def main() -> int: def main() -> int:
@ -17,10 +17,6 @@ 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])
@ -32,7 +28,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)
@ -49,7 +45,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

View File

@ -1,9 +1,12 @@
[tool.poetry] [tool.poetry]
name = "nvexpo" name = "nvexpo"
version = "0.1.0" version = "0.1.1"
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"
@ -20,7 +23,6 @@ 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
@ -39,7 +41,11 @@ ignore = [
"PLR2004", "PLR2004",
"FA102", "FA102",
"PLW2901", "PLW2901",
"N812" "N812",
"C901",
"PLR0912",
"D213",
"D211"
] ]
fixable = ["ALL"] fixable = ["ALL"]

View File

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