File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -243,11 +243,19 @@ $(go mod why ${loopback_deps})"
243
243
244
244
# prune unused pinned replace directives
245
245
comm -23 \
246
- <( go mod edit -json | jq -r ' .Replace[] | select(.Old.Path == .New.Path) | select(.New.Version != null) | .Old.Path' | sort) \
246
+ <( go mod edit -json | jq -r ' .Replace[] | .Old.Path' | sort) \
247
247
<( go list -m -json all | jq -r .Path | sort) |
248
248
xargs -L 1 -I {} echo " -dropreplace={}" |
249
249
xargs -L 100 go mod edit -fmt
250
250
251
+ # prune replace directives that pin to the naturally selected version
252
+ go list -m -json all |
253
+ jq -r ' select(.Replace != null) |
254
+ select(.Path == .Replace.Path) |
255
+ select(.Version == .Replace.Version) |
256
+ "-dropreplace \(.Replace.Path)"' |
257
+ xargs -L 100 go mod edit -fmt
258
+
251
259
popd > /dev/null 2>&1
252
260
done
253
261
echo " === tidying root" >> " ${LOG_FILE} "
You can’t perform that action at this time.
0 commit comments