Skip to content

mecfs_bio.build_system.task.make_executable_wrapper_task

Task to make a file executable by editing unix file permissions (a la chmod).

Classes:

MakeExecutableWrapperTask

Bases: Task

Methods:

Attributes:

deps property

deps: list[Task]

meta property

meta: Meta

execute

execute(scratch_dir: Path, fetch: Fetch, wf: WF) -> Asset
Source code in mecfs_bio/build_system/task/make_executable_wrapper_task.py
def execute(self, scratch_dir: Path, fetch: Fetch, wf: WF) -> Asset:
    asset = self._inner.execute(scratch_dir=scratch_dir, fetch=fetch, wf=wf)
    assert isinstance(asset, FileAsset)
    current_permissions = asset.path.stat().st_mode
    new_permissions = (
        current_permissions | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
    )
    os.chmod(asset.path, new_permissions)
    return asset