Skip to content

Commit 105b054

Browse files
committed
add variable-appendix to only contain a single IP
1 parent 80f7f6b commit 105b054

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/util.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def format_var(name: str, data: list, version: int, fallback: str = None) -> str
4747
if version not in FALLBACK_VAR_VALUE:
4848
version = 4
4949

50+
if name.endswith(VAR_SINGLE_END) and len(data) > 0:
51+
data = [data[0]]
52+
5053
append = APPENDIX_4 if version == 4 else APPENDIX_6
5154

5255
if append not in [None, ' ', '']:
5356
name = f'{name}_{append}'
5457

55-
if name.endswith(VAR_SINGLE_END) and len(data) > 0:
56-
data = data[0]
57-
5858
if len(data) > 1:
5959
raw = f"define { name } = {{ %s }}"
6060

0 commit comments

Comments
 (0)