===================================================================== --- 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
22 lines
630 B
Python
22 lines
630 B
Python
from os import getenv
|
|
from pathlib import Path
|
|
from subprocess import run as subprocess_run
|
|
|
|
|
|
def run(scwrypt_name, *args):
|
|
DEPTH = int(getenv('SUBSCWRYPT', '0'))
|
|
DEPTH += 1
|
|
|
|
SCWRYPTS_EXE = Path(__file__).parents[2] / 'scwrypts'
|
|
ARGS = ' '.join([str(x) for x in args])
|
|
|
|
print(f'\n {"--"*DEPTH} ({DEPTH}) BEGIN SUBSCWRYPT : {Path(scwrypt_name).name}')
|
|
subprocess_run(
|
|
f'SUBSCWRYPT={DEPTH} {SCWRYPTS_EXE} {scwrypt_name} -- {ARGS}',
|
|
shell=True,
|
|
executable='/bin/zsh',
|
|
check=False,
|
|
)
|
|
|
|
print(f' {"--"*DEPTH} ({DEPTH}) END SUBSCWRYPT : {Path(scwrypt_name).name}\n')
|