File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 1+ import shutil
12import subprocess
23import sysconfig
34
@@ -10,21 +11,22 @@ def pdm_build_initialize(context):
1011 context .ensure_build_dir ()
1112 target = context .root / "scripts" / "bids-validator-deno"
1213
13- try :
14- subprocess .run (
15- [
16- "deno" ,
17- "compile" ,
18- "-ERNW" ,
19- "--allow-run" ,
20- "-o" ,
21- str (target ),
22- "src/bids-validator.ts" ,
23- ],
24- check = True ,
25- )
26- except FileNotFoundError :
14+ deno = shutil .which ("deno" )
15+ if deno is None :
2716 raise OSError ("Deno is not installed or not in PATH" )
2817
18+ subprocess .run (
19+ [
20+ deno ,
21+ "compile" ,
22+ "-ERNW" ,
23+ "--allow-run" ,
24+ "-o" ,
25+ str (target ),
26+ "src/bids-validator.ts" ,
27+ ],
28+ check = True ,
29+ )
30+
2931 platform_tag = sysconfig .get_platform ().replace ("-" , "_" ).replace ("." , "_" )
3032 context .config_settings ["--plat-name" ] = platform_tag
You can’t perform that action at this time.
0 commit comments