Fix workspaces/worktrees not deleting cleanly
CI / Test (push) Successful in 52s

This commit is contained in:
raucao committed 2026-11-24 15:08:01 +04:00
1 parent 97126c0684
commit 0792b3f45a
1 file changed
+25 -1
+25 -1
View File
@@ -1,6 +1,18 @@
#!/usr/bin/env bash
set -e
fix_ownership() {
local owner
owner="$(stat -c '%u:%g' /akkounts 2>/dev/null || true)"
if [ -z "$owner" ] || [ "$owner" = "0:0" ]; then
return 0
fi
find /akkounts -xdev \( -user root -o -group root \) \
-exec chown -h "$owner" {} + 2>/dev/null || true
}
fix_ownership
if [ ! -f tmp/.setup-complete ]; then
echo "First start: setting up LDAP entries and databases..."
bin/rails ldap:setup
@@ -11,4 +23,16 @@ else
fi
rm -f tmp/pids/server.pid
exec bin/dev
bin/dev &
dev_pid=$!
trap 'kill -TERM "$dev_pid" 2>/dev/null || true' INT TERM
trap fix_ownership EXIT
status=0
while :; do
wait "$dev_pid" || status=$?
kill -0 "$dev_pid" 2>/dev/null || break
done
exit "$status"