Skip to content

Commit 0abe3a4

Browse files
committed
make source_name optional
1 parent afe6ded commit 0abe3a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/skel.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ def new_problem() -> None:
128128
source_name = ask_variable_string(
129129
"source", variables.get("source", variables.get("name", "")), True
130130
)
131-
source_url = ask_variable_string("source url", variables.get("source_url", ""), True)
132-
variables["source"] = (
133-
f"source:\n name: {source_name}\n{f' url: {source_url}' if source_url else ' #url:'}"
134-
)
131+
if source_name:
132+
source_url = ask_variable_string("source url", variables.get("source_url", ""), True)
133+
variables["source"] = (
134+
f"source:\n name: {source_name}\n{f' url: {source_url}' if source_url else ' #url:'}"
135+
)
135136

136137
variables["license"] = ask_variable_choice(
137138
"license", config.KNOWN_LICENSES, variables.get("license", None)

0 commit comments

Comments
 (0)