Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive_dependencies.sh: Handle no dependencies #463

Merged
merged 2 commits into from
Jan 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions image/archive_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
# This should be reviewed before each release to make sure we're capturing all
# the dependencies we need.

rm dependencies-src.zip || true

dependencies=("slog-json")

zip="$(pwd)/dependencies-src.zip"

rm "$zip" || true

echo "Archiving dependencies to: $zip"

# create an empty zip, so we always have a file, even if we don't have dependencies
echo UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA== | base64 -d > "$zip"

pushd "$CARGO_HOME/registry/src"
for d in "${dependencies[@]}"; do
find . -type d -name "$d-*" | xargs -I {} zip -rv "$zip" "{}"
find . -type d -name "$d-*" | xargs -I {} zip -ruv "$zip" "{}"
done
popd