2020-08-05 02:31:18 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
pkgs.writeShellScriptBin "depot-scan" ''
|
|
|
|
set -euo pipefail
|
|
|
|
|
2020-08-05 02:57:01 +02:00
|
|
|
path="''${1:-$(git rev-parse --show-prefix)}"
|
2020-08-05 02:31:18 +02:00
|
|
|
path="''${path%%/}"
|
|
|
|
attr="''${path//\//.}"
|
|
|
|
root="$(git rev-parse --show-toplevel)"
|
|
|
|
echo "scanning //$path" >&2
|
2020-08-05 03:52:12 +02:00
|
|
|
nix-instantiate -E "import ${./wrap.nix} $root" -A "$attr" -vv 2> >(${pkgs.perl}/bin/perl ${./depot-scan.pl}) >&2
|
2020-08-05 02:31:18 +02:00
|
|
|
''
|