Skip to content

Commit

Permalink
Show errors if vercel subcommand errors, closes #57
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 13, 2022
1 parent 620de38 commit eb7d679
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions datasette_publish_vercel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
value_as_boolean,
ValueAsBooleanError,
)
from subprocess import run
import click
from click.types import CompositeParamType
import json
import os
import pathlib
import re
import shutil
import subprocess

INDEX_PY = """
import asyncio
Expand Down Expand Up @@ -299,7 +299,10 @@ def _publish_vercel(
cmd.extend(["--scope", scope])
# Add the secret
cmd.extend(["--env", "DATASETTE_SECRET={}".format(secret)])
run(cmd)
try:
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as ex:
raise click.ClickException(str(ex))


@hookimpl
Expand Down

0 comments on commit eb7d679

Please sign in to comment.