Skip to content

Commit

Permalink
fix: fix issue preventing scripts from being made executable
Browse files Browse the repository at this point in the history
  • Loading branch information
jayanthkoushik committed Jun 20, 2024
1 parent aad1765 commit dd3b3d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/pyseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
2 changes: 1 addition & 1 deletion src/pyseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
4 changes: 4 additions & 0 deletions tests/test_pyseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd3b3d2

Please sign in to comment.