# Git tracks the executable bit in the tree object mode (100755 vs 100644) # independent of the filesystem, but a Windows checkout won't set it for # you on `git add`. Without this, s6-supervise fails to exec these scripts # on the real target, and nothing in the syntax/lint checks would catch it. param() $ErrorActionPreference = "Stop" $repoRoot = Split-Path -Parent $PSScriptRoot Set-Location $repoRoot $scriptNames = @('run', 'up', 'down', 'finish', 'reload', 'check') $files = Get-ChildItem -Path (Join-Path $repoRoot 'services') -Recurse -File | Where-Object { $scriptNames -contains $_.Name } foreach ($f in $files) { $relPath = (Resolve-Path -Relative $f.FullName) -replace '\\', '/' git add -- $relPath | Out-Null git update-index --chmod=+x -- $relPath } Write-Host "Set executable bit on $($files.Count) file(s)."