Skip to content

Commit c1db8bc

Browse files
committed
re-enable allfollow.
Now that allfollow is [deterministic](spikespaz/allfollow#1) we no longer have to use jq to sort its output. We now use `delta` instead of `difftasitc` to fail if flake.lock was not already pruned. I'm not sure now that we need an `allfollow check` command, since it is better for users to see a nice diff as error message. Related: spikespaz/allfollow#7
1 parent d5b2e47 commit c1db8bc

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

modules/allfollow.nix

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,17 @@ let
3737
name = "allfollow-run";
3838
runtimeInputs = [
3939
pkgs.nix
40-
pkgs.difftastic
41-
pkgs.jq
40+
pkgs.delta
4241
inputs'.allfollow.packages.default
4342
];
4443
text = ''
4544
if [ "apply" == "''${1:-}" ]; then
4645
nix flake lock
47-
allfollow prune --pretty "''${2}" -o - | jq -S . > flake.lock.pruned
48-
mv flake.lock.pruned "''${2}"
46+
allfollow prune --in-place --pretty "''${2}"
4947
fi
5048
if [ "check" == "''${1:-}" ]; then
51-
allfollow prune "''${2}" --pretty -o pruned.lock
52-
allfollow count --json --pretty -o - pruned.lock | jq -S . > pruned.json
53-
allfollow count --json --pretty -o - "''${2}" | jq -S . > current.json
54-
difft --exit-code --display inline pruned.json current.json
49+
allfollow prune --pretty "''${2}" -o pruned.lock
50+
delta --paging never --side-by-side pruned.lock "''${2}"
5551
fi
5652
'';
5753
}

modules/write-flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
text = ''
122122
set -e
123123
cp ${formatted} flake.nix
124-
# ${lib.getExe allfollow-run} apply
124+
${lib.getExe allfollow-run} apply
125125
'';
126126
};
127127

@@ -133,7 +133,7 @@
133133
''
134134
set -e
135135
delta --paging never --side-by-side ${formatted} ${inputs.self}/flake.nix
136-
# ${lib.getExe allfollow-run} check ${inputs.self}/flake.lock
136+
${lib.getExe allfollow-run} check ${inputs.self}/flake.lock
137137
touch $out
138138
'';
139139
in

0 commit comments

Comments
 (0)