Skip to content

Commit

Permalink
feat(bazel): add bzlmod integrity gen function (ohmyzsh#12797)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlo Sala <[email protected]>
  • Loading branch information
hofbi and carlosala authored Nov 19, 2024
1 parent 1b9d6e5 commit 9991822
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 14 additions & 7 deletions plugins/bazel/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Bazel plugin

This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool that scalably supports multi-language and multi-platform projects.
This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool
that scalably supports multi-language and multi-platform projects.

To use it, add `bazel` to the plugins array in your zshrc file:

Expand All @@ -14,9 +15,15 @@ The plugin has a copy of [the completion script from the git repository][1].

## Aliases

| Alias | Command | Description |
| ------- | -------------------------------------- | ------------------------------------------------------ |
| bzb | `bazel build` | The `bazel build` command |
| bzt | `bazel test` | The `bazel test` command |
| bzr | `bazel run` | The `bazel run` command |
| bzq | `bazel query` | The `bazel query` command |
| Alias | Command | Description |
| ----- | ------------- | ------------------------- |
| bzb | `bazel build` | The `bazel build` command |
| bzt | `bazel test` | The `bazel test` command |
| bzr | `bazel run` | The `bazel run` command |
| bzq | `bazel query` | The `bazel query` command |

## Functions

| Function | Description |
| -------- | -------------------------------- |
| sri-hash | Generate SRI hash used by bzlmod |
4 changes: 4 additions & 0 deletions plugins/bazel/bazel.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ alias bzb='bazel build'
alias bzt='bazel test'
alias bzr='bazel run'
alias bzq='bazel query'

sri-hash() {
openssl dgst -sha256 -binary $1 | openssl base64 -A | sed 's/^/sha256-/'
}

0 comments on commit 9991822

Please sign in to comment.