From 43d2ba62759a2d62a43b3c27ecb4776267fd3a92 Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Mon, 18 May 2020 15:42:42 +1200 Subject: [PATCH] Format lock files for nicer diffs. --- jpm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jpm b/jpm index ece0a60d..c5d7908b 100755 --- a/jpm +++ b/jpm @@ -758,8 +758,15 @@ int main(int argc, const char **argv) { (unless made-progress (error (string/format "could not resolve package order for: %j" (filter (complement resolved) (map |($ :repo) packages)))))) - # Write to file - (with [f (file/open filename :w)] (with-dyns [:out f] (printf "%j" ordered-packages)))) + # Write to file, manual format for better diffs. + (with [f (file/open filename :w)] + (with-dyns [:out f] + (prin "@[") + (eachk i ordered-packages + (unless (zero? i) + (prin "\n ")) + (prinf "%j" (ordered-packages i))) + (print "]")))) (defn- load-lockfile [&opt filename]