Skip to content

Commit f08e5e7

Browse files
committed
fix install-binary.sh version specification
This fixes a bug where the --version flag that can be passed to `helm plugin install` was not working with the install-binary.sh script that this repository uses to install the binary files for users. The issue was that the Helm runs install hooks in the current working directory [1], so the `git describe` command that this repository was executing was not being executed in the directory of the plugin, and would thus always fail. The fix here is to use the `-C` flag to git to specify the directory of the plugin source, ensuring that it will work correctly regardless of the working directory from which the script is executed. Closes #50 [1] https://github.com/kubernetes/helm/blob/401f8bcc187d7a9edeec12c26c64819f105954d5/cmd/helm/plugin.go#L48-L72
1 parent 242ab78 commit f08e5e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

install-binary.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ verifySupported() {
6767
# getDownloadURL checks the latest available version.
6868
getDownloadURL() {
6969
local url="https://api.github.com/repos/$PROJECT_GH/releases/latest"
70-
local version=$(git describe --tags --exact-match 2>/dev/null)
70+
local version=$(git -C $HELM_PLUGIN_PATH describe --tags --exact-match 2>/dev/null)
7171
if [ -n "$version" ]; then
7272
url="https://api.github.com/repos/$PROJECT_GH/releases/tags/$version"
7373
fi

0 commit comments

Comments
 (0)