diff --git a/dist/pyseed.py b/dist/pyseed.py index dfa3b76..f93bad0 100755 --- a/dist/pyseed.py +++ b/dist/pyseed.py @@ -797,7 +797,7 @@ def init_project(config: dict[ConfigKey, Any]): for script_path in (project_path / scripts_dir).glob("*"): vprint(f"+ CHMOD+x {script_path}", file=sys.stderr) os.chmod( - fpath, + script_path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH, ) diff --git a/src/pyseed.py b/src/pyseed.py index a52163c..67e77ad 100644 --- a/src/pyseed.py +++ b/src/pyseed.py @@ -795,7 +795,7 @@ def init_project(config: dict[ConfigKey, Any]): for script_path in (project_path / scripts_dir).glob("*"): vprint(f"+ CHMOD+x {script_path}", file=sys.stderr) os.chmod( - fpath, + script_path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH, ) diff --git a/tests/test_pyseed.py b/tests/test_pyseed.py index a2e2dbf..9ee5c88 100644 --- a/tests/test_pyseed.py +++ b/tests/test_pyseed.py @@ -782,6 +782,10 @@ def test_init_project_writes_all_expected_files(self): self.assertEqual( (www_src_dir / "index.md").resolve(), (project_dir / "README.md").resolve() ) + scripts_dir = project_dir / "scripts" + for fpath in scripts_dir.glob("*"): + with self.subTest(fpath): + self.assertTrue(os.access(fpath, os.X_OK)) def test_init_project_writes_all_expected_files_in_barebones_mode(self): self.config[pyseed.ConfigKey.barebones] = True