Skip to content

Commit aec4405

Browse files
committed
Lift Windows detection to a single variable
1 parent 0dda711 commit aec4405

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake-init/__main__.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
zip = zipfile.ZipFile(os.path.dirname(__file__), "r")
3939

40+
is_windows = os.name == "nt"
41+
4042

4143
def not_empty(value):
4244
return len(value) != 0
@@ -123,7 +125,7 @@ def ask(*args, **kwargs):
123125
header="This will require you to download clang-tidy locally.",
124126
) == "y",
125127
"examples": False,
126-
"os": "win64" if os.name == "nt" else "unix",
128+
"os": "win64" if is_windows else "unix",
127129
}
128130
d["uc_name"] = d["name"].upper().replace("-", "_")
129131
if d["type_id"] != "e":
@@ -192,8 +194,8 @@ def git_init(cwd):
192194

193195

194196
def print_tips(d):
195-
config = " --config Release" if os.name == "nt" else ""
196-
test_cfg = " -C Release" if os.name == "nt" else ""
197+
config = " --config Release" if is_windows else ""
198+
test_cfg = " -C Release" if is_windows else ""
197199
cpus = os.cpu_count()
198200
print(f"""\
199201
To get you started with the project in developer mode, you may configure,

0 commit comments

Comments
 (0)