Skip to content

Commit

Permalink
store-scan: improve error handling when store listing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed May 7, 2024
1 parent 991af99 commit 08dcf70
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dist/main/push-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,21 @@ filterPaths() {
done | xargs
}

pathsToPush=$(comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh))
pathsToPush=""
preBuildPaths=$(sort /tmp/store-path-pre-build)
if [ $? -eq 0 ]; then
postBuildPaths=$("$(dirname "$0")"/list-nix-store.sh | sort)
if [ $? -eq 0 ]; then
pathsToPush=$(comm -13 <(echo "$preBuildPaths") <(echo "$postBuildPaths"))
else
echo "::error::Failed to list post-build store paths."
fi
else
echo "::error::Failed to find pre-build store paths."
fi

if [[ -n $pushFilter ]]; then
pathsToPush=$(filterPaths $pushFilter "$pathsToPush")
pathsToPush=$(filterPaths $pushFilter "$pathsToPush")
fi

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

0 comments on commit 08dcf70

Please sign in to comment.