Skip to content

Commit 0e63386

Browse files
committed
Entry point scripts with all executable bits set
Prior to emscripten-core#23761, when all the launcher script lived in git, our emscripten-release builder was checking out the launchers scripts and bundling them will `-rwxr-xr-x` permissions. Once emscripten-core#23761, and `create_entry_points.py` was used to create them on demand the `x` bit was lost except for the user. Fixes: emscripten-core/emsdk#1583
1 parent 3d740b8 commit 0e63386

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/maint/create_entry_points.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
}
5959

6060

61+
def make_executable(filename):
62+
old_mode = stat.S_IMODE(os.stat(filename).st_mode)
63+
os.chmod(filename, old_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
64+
65+
6166
def main(all_platforms):
6267
is_windows = sys.platform.startswith('win')
6368
do_unix = all_platforms or not is_windows
@@ -87,7 +92,7 @@ def generate_entry_points(cmd, path):
8792
out_sh_file = os.path.join(__rootdir__, entry_point)
8893
with open(out_sh_file, 'w') as f:
8994
f.write(sh_data)
90-
os.chmod(out_sh_file, stat.S_IMODE(os.stat(out_sh_file).st_mode) | stat.S_IXUSR)
95+
make_executable(out_sh_file)
9196

9297
if do_windows:
9398
with open(os.path.join(__rootdir__, entry_point + '.bat'), 'w') as f:

0 commit comments

Comments
 (0)