Skip to content

Commit

Permalink
fix TypeError in case jar=None
Browse files Browse the repository at this point in the history
  • Loading branch information
dansan committed Nov 27, 2019
1 parent f0f2623 commit eae99f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions update_openapi_client
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def run_openapi_generator_local_java(
jar_path = Path(target_dir, "openapi-generator.jar")
download_jar(jar_path)
cmd = JAVA_COMPILE_CMD.format(
jar=jar_path,
jar=str(jar_path),
schema=str(Path(target_dir, TARGET_SCHEMA_FILENAME)),
target_dir=target_dir,
).split()
Expand Down Expand Up @@ -205,6 +205,8 @@ async def update_openapi_client(
print_error_and_exit(
"The --jar option can only be used together with '--generator java'."
)
if jar:
jar = Path(jar)
txt = get_openapi_schema(host, secure)
with TemporaryDirectory() as temp_dir, open(
Path(temp_dir, TARGET_SCHEMA_FILENAME), "w"
Expand All @@ -219,7 +221,7 @@ async def update_openapi_client(
if generator == "docker":
run_openapi_generator_docker_container(temp_dir, quiet, keep_image)
else:
run_openapi_generator_local_java(temp_dir, quiet, Path(jar))
run_openapi_generator_local_java(temp_dir, quiet, jar)
click.echo("Installing package via pip...")
pip_main(["install", "--compile", "--upgrade", str(Path(temp_dir, "python/"))])

Expand Down

0 comments on commit eae99f7

Please sign in to comment.