fix: detach service startup to prevent nix develop hang
Run start-services in a background subshell with stdin closed so nix develop doesn't wait on daemonized PostgreSQL/Redis child processes before starting the interactive shell.
This commit is contained in:
parent
38b7fb00f1
commit
b7d8ea9668
1 changed files with 4 additions and 7 deletions
|
|
@ -326,14 +326,11 @@ mkShell {
|
|||
mix local.hex --force --if-missing > /dev/null 2>&1
|
||||
mix local.rebar --force --if-missing > /dev/null 2>&1
|
||||
|
||||
# Auto-start services on first shell entry
|
||||
# Auto-start services on first shell entry.
|
||||
# Run in a detached subshell to prevent nix develop from waiting
|
||||
# on daemonized PostgreSQL/Redis child processes.
|
||||
if [ ! -f "${servicesFlag}" ]; then
|
||||
${startServices}/bin/start-services
|
||||
|
||||
# Run migrations if databases exist and Mix deps are available
|
||||
if [ -d "deps" ] && mix ecto.migrate 2>/dev/null; then
|
||||
echo "✓ Database migrations applied"
|
||||
fi
|
||||
( ${startServices}/bin/start-services </dev/null & )
|
||||
fi
|
||||
|
||||
# Install pre-commit hooks
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue