=====================================================================

--- Changes ------------------------------

- python library functions moved to `py/lib`
- python scwrypts renamed in kebob-case to help prevent import
- __name__ == '__main__' enforced on all python scwrypts

--- New Features -------------------------

- `__override` variables now allow values to be force-overwritten
- py.lib.http.client provides a slim `requests.request` wrapper

--- New Scripts --------------------------

py/data/convert )
  quick data converters
   - csv-to-json
   - csv-to-yaml
   - json-to-csv
   - json-to-yaml
   - yaml-to-csv
   - yaml-to-json

py/linear )
  uses the linear.app graphql API for PM tasks
   - comment

--- Bug Fixes ----------------------------

- `scwrypts` handles arguments with quotes and special characters
This commit is contained in:
2023-01-11 17:09:59 -07:00
parent a1256bb0af
commit 7617c938b1
35 changed files with 395 additions and 22 deletions

16
py/lib/scwrypts/getenv.py Normal file
View File

@ -0,0 +1,16 @@
from os import getenv as os_getenv
from py.lib.scwrypts.exceptions import MissingVariableError
from py.lib.scwrypts.run import run
def getenv(name, required=True):
value = os_getenv(name, None)
if value == None:
run('zsh/scwrypts/environment/stage-variables', name)
if required and not value:
raise MissingVariableError(name)
return value