fix: make dev tools executable
This commit is contained in:
@@ -55,19 +55,18 @@ class DevelopmentEnvironment:
|
||||
) from exc
|
||||
if resolved.parent != self.scripts_dir.resolve() or not resolved.is_file():
|
||||
raise DevelopmentEnvironmentError(f"Install script {name!r} is not a regular file")
|
||||
if not os.access(resolved, os.X_OK):
|
||||
raise DevelopmentEnvironmentError(f"Install script {name!r} is not executable")
|
||||
return resolved
|
||||
|
||||
async def _run(self, name: str, script: Path, workspace: Path) -> None:
|
||||
started = monotonic()
|
||||
command = [str(script)] if os.access(script, os.X_OK) else ["/bin/sh", str(script)]
|
||||
log.info(
|
||||
"development install script started",
|
||||
extra={"operation": "development.install", "script": name},
|
||||
)
|
||||
try:
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
str(script),
|
||||
*command,
|
||||
cwd=workspace,
|
||||
env=self._environment(),
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
|
||||
Reference in New Issue
Block a user