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

Update crates_universe render script to run from Bazel #2492

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion crate_universe/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ A lot of crates are vendored into this repo, e.g. in examples and tests. To
re-vendor them all, a bash script is provided:

```sh
./util/vendor.sh
bazel run //crate_universe/tools:vendor
```
5 changes: 5 additions & 0 deletions crate_universe/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ filegroup(
],
visibility = ["//crate_universe:__subpackages__"],
)

sh_binary(
name = "vendor",
srcs = ["vendor.sh"],
)
8 changes: 7 additions & 1 deletion util/vendor.sh → crate_universe/tools/vendor.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

# A script to re-vendor all vendors crates in this repository.
# This should be ran whenever any crate rendering changes.

Expand All @@ -15,7 +17,11 @@ vendor_workspace() {
popd >/dev/null
}

workspaces="$(find -type f -name WORKSPACE.bazel -o -name WORKSPACE -o -name MODULE.bazel)"
if [[ -n "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then
cd "${BUILD_WORKSPACE_DIRECTORY:-}"
fi

workspaces="$(find . -type f -name WORKSPACE.bazel -o -name MODULE.bazel)"

for workspace in $workspaces
do
Expand Down
Loading