nix-direnv-reload 761 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. set -e
  3. if [[ ! -d "/home/johron/Projects/go/moose" ]]; then
  4. echo "Cannot find source directory; Did you move it?"
  5. echo "(Looking for "/home/johron/Projects/go/moose")"
  6. echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
  7. exit 1
  8. fi
  9. # rebuild the cache forcefully
  10. _nix_direnv_force_reload=1 direnv exec "/home/johron/Projects/go/moose" true
  11. # Update the mtime for .envrc.
  12. # This will cause direnv to reload again - but without re-building.
  13. touch "/home/johron/Projects/go/moose/.envrc"
  14. # Also update the timestamp of whatever profile_rc we have.
  15. # This makes sure that we know we are up to date.
  16. touch -r "/home/johron/Projects/go/moose/.envrc" "/home/johron/Projects/go/moose/.direnv"/*.rc