Skip to content

Commit b8944ae

Browse files
committed
Merge in changes from main
1 parent b652fd5 commit b8944ae

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,19 +469,19 @@ steps:
469469

470470
Both field names are supported by Buildkite. The generated pipeline YAML will use `artifact_paths`.
471471

472-
### `download_folder` (optional)
472+
### `binary_folder` (optional)
473473

474474
Default: `BUILDKITE_PLUGINS_PATH`
475475

476-
This is the filesystem folder where the Go binary will be download to.
476+
This is the filesystem folder where the Go binary will be kept.
477477

478478
## Example
479479
```yaml
480480
steps:
481481
- label: "Triggering pipelines"
482482
plugins:
483483
- monorepo-diff#v1.8.0:
484-
download_folder: "/var/buildkite-agent"
484+
binary_folder: "/var/buildkite-agent"
485485
watch:
486486
- path: "bar-service/"
487487
config:

hooks/command

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ err() {
1717
exit 1
1818
}
1919

20-
executable_dir="${BUILDKITE_PLUGIN_MONOREPO_DIFF_DOWNLOAD_FOLDER:-${BUILDKITE_PLUGINS_PATH:-}}"
20+
executable_dir="${BUILDKITE_PLUGIN_MONOREPO_DIFF_BINARY_FOLDER:-${BUILDKITE_PLUGINS_PATH:-}}"
2121

2222
# Default to current directory if not set
2323
if [[ -z "${executable_dir}" || ${BUILDKITE_PLUGIN_MONOREPO_DIFF_BUILDKITE_PLUGIN_TEST_MODE:-false} == "true" ]]; then
@@ -34,7 +34,7 @@ if [[ ! -w "${executable_dir}" ]]; then
3434
err "Directory not writable: ${executable_dir}"
3535
fi
3636

37-
executable="${executable_dir}/monorepo-diff-buildkite-plugin"
37+
executable="${executable_dir%/}/monorepo-diff-buildkite-plugin"
3838
executable_version_file="${executable}.version"
3939

4040
check_cmd() {
@@ -202,10 +202,13 @@ download_binary_and_run() {
202202
}
203203

204204
run_preinstalled_binary() {
205-
local _executable="monorepo-diff-buildkite-plugin"
205+
local _executable="${executable}"
206206

207-
if ! check_cmd "$_executable"; then
208-
err "Binary '$_executable' not found in PATH. Please install it or set download: true"
207+
if ! check_cmd "${_executable}"; then
208+
_executable="$(basename "${executable}")"
209+
if ! check_cmd "${_executable}"; then
210+
err "Binary '$_executable' not found in PATH or binary_folder option. Please install it or set download: true"
211+
fi
209212
fi
210213

211214
${_executable} "$@"

plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ configuration:
1515
type: boolean
1616
env:
1717
type: array
18-
download_folder:
18+
binary_folder:
1919
type: string
2020
notify:
2121
type: [array]

0 commit comments

Comments
 (0)