respect quiet settings and document

This commit is contained in:
sneakers-the-rat 2024-10-17 01:59:38 -07:00
parent 72fcce0247
commit e24c1ff030
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
3 changed files with 13 additions and 5 deletions

View file

@ -71,6 +71,12 @@ pip install no-more-imports
Do not use this package
### Configuration
env vars:
- `NMI_QUIET=true` - don't print anything to stdout like when installing packages we forgot to ask for
## How it Works
Well buster, i gotta say that's a little nosy, but if you must know,

View file

@ -1,6 +1,6 @@
[project]
name = "no-more-imports"
version = "0.1.0"
version = "0.1.1"
description = "python with no imports"
authors = [
{name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com"},

View file

@ -142,10 +142,12 @@ def _do_install(packages: list[str], quiet: bool = False):
res = subprocess.run(['python', '-m', 'pip', 'install', package], capture_output=True)
if res.returncode != 0:
errors.append({'package': package, 'stdout': res.stdout, 'stderr': res.stderr})
if len(errors) == 0:
print("sweet jesus we did it")
else:
print(f"some problems here pal:\n{pformat(errors, indent=2, compact=True)}")
if not quiet:
if len(errors) == 0:
print("sweet jesus we did it")
else:
print(f"some problems here pal:\n{pformat(errors, indent=2, compact=True)}")
def install():