Skip to content

Commit

Permalink
improve err codes, increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklausroach committed Apr 8, 2024
1 parent 7b01cda commit 2bdf643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sprocketship"
version = "0.3.0"
version = "0.4.1"
authors = [
{ name="Nicklaus Roach", email="[email protected]" },
]
Expand Down
10 changes: 6 additions & 4 deletions sprocketship/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def liftoff(dir, show):
configs_with_paths = extract_configs(data["procedures"])
procs = list(itertools.chain(*configs_with_paths.values()))

err = False
for proc in procs:
try:
rendered_proc = create_javascript_stored_procedure(
Expand All @@ -44,6 +45,7 @@ def liftoff(dir, show):
if show:
click.echo(rendered_proc)
except Exception as e:
err = True
msg = click.style(f"{proc['name']} ", fg="red", bold=True)
msg += click.style(
f"could not be launched into schema ", fg="white", bold=True
Expand All @@ -54,8 +56,7 @@ def liftoff(dir, show):
click.echo(msg)
click.echo(e, err=True)
click.echo(rendered_proc)
exit(1)
exit(0)
exit(1 if err else 0)


@main.command()
Expand All @@ -73,6 +74,7 @@ def build(dir, target):
configs_with_paths = extract_configs(data["procedures"])
procs = list(itertools.chain(*configs_with_paths.values()))

err = False
for proc in procs:
try:
rendered_proc = create_javascript_stored_procedure(
Expand All @@ -84,9 +86,9 @@ def build(dir, target):
msg += click.style(f"successfully built", fg="white", bold=True)
click.echo(msg)
except Exception as e:
err = True
msg = click.style(f"{proc['name']} ", fg="red", bold=True)
msg += click.style(f"could not be built", fg="white", bold=True)
click.echo(msg)
click.echo(e, err=True)
exit(1)
exit(0)
exit(1 if err else 0)

0 comments on commit 2bdf643

Please sign in to comment.