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

Fix install script #61

Closed
wants to merge 4 commits into from
Closed

Fix install script #61

wants to merge 4 commits into from

Conversation

jalseth
Copy link

@jalseth jalseth commented Jun 11, 2021

Resolves #60 as well as fixing other issues in the script.


if [ -n $(command -v curl) ]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,11 +1,10 @@
#! /bin/bash -e
#!/bin/bash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@codebling
Copy link

@maxjeffos any chance this will be merged? Install script is still broken.


version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
latest_version=$(curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -i "location" | sed s#.*tag/##g | tr -d "\r")
latest_version=$(curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -E "^Location:" | rev | cut -d"/" -f1 | rev | tr -d "\r\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs case insensitive for the header

Suggested change
latest_version=$(curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -E "^Location:" | rev | cut -d"/" -f1 | rev | tr -d "\r\n")
latest_version=$(curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -Ei "^Location:" | rev | cut -d"/" -f1 | rev | tr -d "\r\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not sure everyone will have rev cut and tr.
With sed:

curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -Ei "^Location:" | sed -E 's:^.*/::'

With grep only

curl -Is "https://github.com/snyk-labs/helm-snyk/releases/latest" | grep -Ei "^Location:" | grep -Eo ' \S+' | grep -Eo '[^/]+$'

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install script is broken
2 participants