Skip to content

Commit 24c6c62

Browse files
committed
change this to a dict
1 parent 6e286cb commit 24c6c62

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

codegen.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ openapi = "lib-openapi.json"
33

44
[rust]
55
template_dir = "rust/templates"
6-
extra_mounts = [["rust/.rustfmt.toml", "/app/.rustfmt.toml"]]
6+
extra_mounts = { "rust/.rustfmt.toml" = "/app/.rustfmt.toml" }
77
extra_shell_commands = ["rm rust/src/api/{environment,health}.rs"]
88
[[rust.task]]
99
template = "rust/templates/api_resource.rs.jinja"
@@ -29,7 +29,7 @@ output_dir = "javascript/src/models"
2929

3030
[cli]
3131
template_dir = "svix-cli/templates"
32-
extra_mounts = [["svix-cli/.rustfmt.toml", "/app/.rustfmt.toml"]]
32+
extra_mounts = { "svix-cli/.rustfmt.toml" = "/app/.rustfmt.toml" }
3333
extra_shell_commands = [
3434
"cargo fix --manifest-path svix-cli/Cargo.toml --allow-dirty",
3535
"cargo fmt --manifest-path svix-cli/Cargo.toml",

regen_openapi.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ def docker_container_create(prefix, task) -> str:
8484
"--mount",
8585
f"type=bind,src={Path(task['template_dir']).absolute()},dst=/app/{task['template_dir']},ro",
8686
]
87-
for extra_mount in task["extra_mounts"]:
87+
88+
for extra_mount_src, extra_mount_dst in task["extra_mounts"].items():
8889
cmd.append("--mount")
8990
cmd.append(
90-
f"type=bind,src={Path(extra_mount[0]).absolute()},dst={extra_mount[1]},ro"
91+
f"type=bind,src={Path(extra_mount_src).absolute()},dst={extra_mount_dst},ro"
9192
)
9293
cmd.extend(
9394
[
@@ -224,7 +225,7 @@ def parse_config():
224225
),
225226
"template": task["template"],
226227
"output_dir": task["output_dir"],
227-
"extra_mounts": language_config.get("extra_mounts", []),
228+
"extra_mounts": language_config.get("extra_mounts", {}),
228229
"extra_codegen_args": task.get("extra_codegen_args", []),
229230
"template_dir": language_config["template_dir"],
230231
}

0 commit comments

Comments
 (0)