Added chmod settings

This commit is contained in:
Kevin Veen-Birkenbach
2025-03-06 12:42:49 +01:00
parent bcd9b41173
commit 2035367fa7

View File

@@ -8,6 +8,7 @@ def create_ink(repo, repositories_base_dir, bin_dir, all_repos, quiet=False, pre
Instead of creating an executable wrapper, this function creates a symlink Instead of creating an executable wrapper, this function creates a symlink
that points to the command file within the repository (e.g., main.sh or main.py). that points to the command file within the repository (e.g., main.sh or main.py).
It also ensures that the command file has executable permissions.
""" """
repo_identifier = get_repo_identifier(repo, all_repos) repo_identifier = get_repo_identifier(repo, all_repos)
repo_dir = get_repo_dir(repositories_base_dir, repo) repo_dir = get_repo_dir(repositories_base_dir, repo)
@@ -25,6 +26,14 @@ def create_ink(repo, repositories_base_dir, bin_dir, all_repos, quiet=False, pre
print(f"No command defined and neither main.sh nor main.py found in {repo_dir}. Skipping link creation.") print(f"No command defined and neither main.sh nor main.py found in {repo_dir}. Skipping link creation.")
return return
# Ensure the command file is executable.
if not preview:
try:
os.chmod(command, 0o755)
except Exception as e:
if not quiet:
print(f"Failed to set executable permissions for {command}: {e}")
link_path = os.path.join(bin_dir, repo_identifier) link_path = os.path.join(bin_dir, repo_identifier)
if preview: if preview:
print(f"[Preview] Would create symlink '{link_path}' pointing to '{command}'.") print(f"[Preview] Would create symlink '{link_path}' pointing to '{command}'.")