-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
===================================================================== Subscwrypts + Environment Inheritance --- Release Notes ------------------------ - added support for environment inheritance - added support for arbitrarily nested scripts (subscwrypts) - added support for CI mode - improved modularity of zsh/utils module - refactored to move some data from ~/.config/scwrypts to ~/.local/share/scwrypts - refactored various scripts to use new subscwrypt api --- New Scripts -------------------------- zsh ) - db/interactive/postgres - aws/rds/interactive-login
- Loading branch information
Showing
34 changed files
with
740 additions
and
230 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.zsh diff | ||
.config diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
__pycache__/ | ||
*.py[cod] | ||
*.so | ||
.env/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from py.scwrypts.getenv import getenv | ||
from py.scwrypts.interactive import interactive | ||
from py.scwrypts.run import run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
from os import getenv as os_getenv | ||
from pathlib import Path | ||
from subprocess import run | ||
|
||
from py.scwrypts.exceptions import MissingVariableError | ||
from py.scwrypts.run import run | ||
|
||
|
||
def getenv(name, required=True): | ||
value = os_getenv(name, None) | ||
|
||
if value == None: | ||
ZSH_COMMAND = Path(__file__).parents[2] / 'zsh/scwrypts/environment/stage-variables' | ||
run('zsh/scwrypts/environment/stage-variables', name) | ||
|
||
run( | ||
f'{ZSH_COMMAND} {name}', | ||
shell=True, | ||
executable='/bin/zsh', | ||
) | ||
|
||
if required: | ||
raise MissingVariableError(name) | ||
if required and not value: | ||
raise MissingVariableError(name) | ||
|
||
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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 | ||
|
||
print(f'\n {"--"*DEPTH} ({DEPTH}) BEGIN SUBSCWRYPT : {Path(scwrypt_name).name}') | ||
subprocess_run( | ||
f'SUBSCWRYPT={DEPTH} {Path(__file__).parents[2] / "scwrypts"} {scwrypt_name} -- {" ".join([str(x) for x in args])}', | ||
shell=True, | ||
executable='/bin/zsh', | ||
) | ||
|
||
print(f' {"--"*DEPTH} ({DEPTH}) END SUBSCWRYPT : {Path(scwrypt_name).name}\n') |
Oops, something went wrong.