Skip to content

Commit

Permalink
Clarify direnv script steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Dec 18, 2024
1 parent 8c04d67 commit 0128073
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .flox/bin/direnv-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ case "$shell_name" in
;;
esac

# Add hook to shell config if not already present
if ! grep -q "warn_timeout" "$HOME/.config/direnv/direnv.toml" 2>/dev/null; then
echo "[global]\nwarn_timeout = 0 # Ignore timeout from this issue: https://github.com/direnv/direnv/issues/1065 - added by PostHog's Flox activation hook (../posthog/.flox/env/manifest.toml)" >> "$HOME/.config/direnv/direnv.toml"
echo "✅ Configured ~/.config/direnv/direnv.toml"
else
echo "⏩ ~/.config/direnv/direnv.toml already configured"
fi
echo "🐚 Configuring your default shell, $SHELL, for direnv"

# Add hook to shell config if not already present
if ! grep -q "direnv hook" "$config_file" 2>/dev/null; then
Expand All @@ -62,6 +56,14 @@ else
echo "⏩ direnv hook already present in $config_file"
fi

# Add hook to shell config if not already present
if ! grep -q "warn_timeout" "$HOME/.config/direnv/direnv.toml" 2>/dev/null; then
echo "[global]\nwarn_timeout = 0 # Ignore timeout from this issue: https://github.com/direnv/direnv/issues/1065 - added by PostHog's Flox activation hook (../posthog/.flox/env/manifest.toml)" >> "$HOME/.config/direnv/direnv.toml"
echo "✅ Configured ~/.config/direnv/direnv.toml"
else
echo "⏩ ~/.config/direnv/direnv.toml already configured"
fi

echo "💫 direnv is now active"

# Allow this directory's .envrc to be loaded
Expand Down

0 comments on commit 0128073

Please sign in to comment.