We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b978fc commit c75b3dbCopy full SHA for c75b3db
1 file changed
bin/new.py
@@ -6,6 +6,7 @@
6
7
import argparse
8
import os
9
+import platform
10
import re
11
import subprocess
12
import sys
@@ -83,7 +84,10 @@ def main() -> None:
83
84
sys.exit('Will not overwrite. Bye!')
85
86
print(body(args), file=open(program, 'wt'), end='')
- subprocess.run(['chmod', '+x', program])
87
+
88
+ if platform.system() != 'Windows':
89
+ subprocess.run(['chmod', '+x', program], check=True)
90
91
print(f'Done, see new script "{program}."')
92
93
0 commit comments