Skip to content

Commit 08dcf70

Browse files
committed
store-scan: improve error handling when store listing fails
1 parent 991af99 commit 08dcf70

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

dist/main/push-paths.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,21 @@ filterPaths() {
1212
done | xargs
1313
}
1414

15-
pathsToPush=$(comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh))
15+
pathsToPush=""
16+
preBuildPaths=$(sort /tmp/store-path-pre-build)
17+
if [ $? -eq 0 ]; then
18+
postBuildPaths=$("$(dirname "$0")"/list-nix-store.sh | sort)
19+
if [ $? -eq 0 ]; then
20+
pathsToPush=$(comm -13 <(echo "$preBuildPaths") <(echo "$postBuildPaths"))
21+
else
22+
echo "::error::Failed to list post-build store paths."
23+
fi
24+
else
25+
echo "::error::Failed to find pre-build store paths."
26+
fi
1627

1728
if [[ -n $pushFilter ]]; then
18-
pathsToPush=$(filterPaths $pushFilter "$pathsToPush")
29+
pathsToPush=$(filterPaths $pushFilter "$pathsToPush")
1930
fi
2031

2132
echo "$pathsToPush" | "$cachix" push $cachixArgs "$cache"

0 commit comments

Comments
 (0)