config/.envrc

29 lines
651 B
Plaintext
Raw Normal View History

2023-03-03 21:42:29 +01:00
#!/usr/bin/env bash
git config --local core.hooksPath "$PWD"/.githooks
2023-03-07 23:56:50 +01:00
test -d .direnv || mkdir -p .direnv
now="$(date +%Y-%m-%d)"
if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; then
2024-02-29 18:40:19 +01:00
git reset flake.lock
git restore flake.lock
2023-03-11 15:59:56 +01:00
git pull --rebase --autostash
2024-02-29 18:40:19 +01:00
grep -q "^=======" flake.lock && { git reset flake.lock; rm flake.lock; }
2024-01-10 22:21:33 +01:00
nix flake update
2023-03-11 15:59:56 +01:00
echo "$now" > .direnv/pull-date
2023-03-07 23:56:50 +01:00
fi
2023-03-11 15:59:56 +01:00
2024-06-06 14:10:35 +02:00
if ! test -f .remote.toml; then
2023-06-24 19:11:49 +02:00
use flake .#envrc-local
else
2023-06-18 05:10:08 +02:00
use flake .#envrc-remote
2023-03-11 15:59:56 +01:00
echo
2024-02-22 20:47:56 +01:00
just remote-current
just remote-list
2023-03-11 15:59:56 +01:00
echo
2023-03-03 02:24:07 +01:00
fi
2023-03-19 04:23:38 +01:00
if rg 'TODO' -q ; then
echo "There are $(rg 'TODO' | wc -l ) 'TODO'"
fi