summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/main.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/main.sh b/scripts/main.sh
index e8d006d..a9afde3 100755
--- a/scripts/main.sh
+++ b/scripts/main.sh
@@ -1,7 +1,11 @@
#!/bin/bash
-set -e
+set -ex
go build ./cmd/btrfs-rec
if ! test -s ../scratch/dump.scan-for-nodes.json; then
- time ./btrfs-rec --pv=../scratch/dump-zero.img inspect scan-for-nodes > ../scratch/dump.scan-for-nodes.json ||
- { r=$?; rm -f ../scratch/dump.scan-for-nodes.json; exit $r; }
+ time ./btrfs-rec --pv=../scratch/dump-zero.img inspect scan-for-nodes > ../scratch/dump.scan-for-nodes.json
+fi
+if ! test -s ../scratch/dump.rebuilt-mappings.json; then
+ time ./btrfs-rec --pv=../scratch/dump-zero.img inspect rebuild-mappings ../scratch/dump.scan-for-nodes.json \
+ > ../scratch/dump.rebuilt-mappings.json \
+ 2> >(tee >&2 ../scratch/dump.rebuilt-mappings.log)
fi