cachix/ghcide-nix

update script is broken because revision is quoted

Closed this issue · 0 comments

[nix-shell:~/ghcide-nix]$ ./update 
Update ghcide
WARNING: nix/sources.nix is out of date.
Please run
  niv init
or add the following line in the nix/sources.nix  file:
  # niv: no_update

  Reading sources file
Done: Update ghcide
Update haskell.nix
WARNING: nix/sources.nix is out of date.
Please run
  niv init
or add the following line in the nix/sources.nix  file:
  # niv: no_update

  Reading sources file
Done: Update haskell.nix
"cec3159ace4c430ccb6f58733245e67f7ebe30fb"
Cloning into 'ghcide'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 2157 (delta 2), reused 3 (delta 1), pack-reused 2146
Receiving objects: 100% (2157/2157), 608.43 KiB | 2.01 MiB/s, done.
Resolving deltas: 100% (1136/1136), done.
~/ghcide-nix/ghcide ~/ghcide-nix
error: pathspec '"cec3159ace4c430ccb6f58733245e67f7ebe30fb"' did not match any file(s) known to git

Hacky(?) fix

-rev=$(nix-instantiate --eval -E "(builtins.fromJSON (builtins.readFile ./nix/sources.json)).ghcide.rev")
+qrev=$(nix-instantiate --eval -E "(builtins.fromJSON (builtins.readFile ./nix/sources.json)).ghcide.rev")
+rev=$(echo $qrev | tr -d "\"")