Skip to content

Commit 9db8d70

Browse files
Moved gosec to its own function in buildAndDeploy Fixed #882
1 parent 8017dcc commit 9db8d70

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

bin/buildAndDeploy.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def runTests() -> None:
9494
except subprocess.CalledProcessError as e:
9595
print(f"[red]>>> Go Test failed <<<")
9696
sys.exit(e.returncode)
97+
98+
def runGoSec() -> None:
99+
"""Runs gpsec"""
97100
go_sec = ['gosec', '-exclude-dir=fixture', '-exclude-dir=plugin/resources', '-exclude-generated', './...']
98101
# Not using the 'real' command because this is more copy/pasteable.
99102
print('[turquoise2]Running: ' + " ".join(go_sec))
@@ -392,6 +395,12 @@ def test(ctx):
392395
"""Runs the tests"""
393396
runTests()
394397

398+
@cli.command()
399+
@click.pass_context
400+
def gosec(ctx):
401+
"""Runs the tests"""
402+
runGoSec()
403+
395404
@cli.command()
396405
@click.pass_context
397406
def i18n(ctx):
@@ -412,8 +421,3 @@ def docs(ctx, out_path):
412421

413422
if __name__ == '__main__':
414423
cli()
415-
# try:
416-
# cli()
417-
# except Exception as e:
418-
# print(f"[red]{e}")
419-

0 commit comments

Comments
 (0)