Skip to content

Disabling grep colouring mode directly for the execution #179

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

Merged
merged 1 commit into from
Feb 17, 2020
Merged

Disabling grep colouring mode directly for the execution #179

merged 1 commit into from
Feb 17, 2020

Conversation

gabor-boros
Copy link
Contributor

Short description

Disabling grep colouring mode directly for the execution, because it causes issues when accessing the url with curl if GREP_COLOR is set to always.

As you can see below, curl will use invalid url set by getDownloadURL function. The issue is in line 76 of the install/update script where the OS name is grepped. (https://github.com/databus23/helm-diff/blob/master/install-binary.sh#L76)

If colouring mode is disabled for grep, it will not include the terminal colouring chars in the download url and the new release can be downloaded.

curl: (3) bad range in URL position 82: https://github.com/databus23/helm-diff/releases/download/v3.0.0-rc.7/helm-diff-\u001b[01;31m\u001b[Kmacos\u001b[m\u001b[K.tgz

Full error message

TASK [helm_diff : Update helm diff plugin] ****************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => { 
    "changed":true,
    "cmd":[ 
        "helm",
        "plugin",
        "update",
        "diff"
    ],
    "delta":"0:00:01.899889",
    "end":"2020-01-14 13:16:33.103668",
    "msg":"non-zero return code",
    "rc":1,
    "start":"2020-01-14 13:16:31.203779",
    "stderr":"curl: (3) bad range in URL position 82:\nhttps://github.com/databus23/helm-diff/releases/download/v3.0.0-rc.7/helm-diff-\u001b[01;31m\u001b[Kmacos\u001b[m\u001b[K.tgz\n                                                                                 ^\nError: Failed to update plugin diff, got error (plugin update hook for \"diff\" exited with error)",
    "stderr_lines":[ 
        "curl: (3) bad range in URL position 82:",
        "https://github.com/databus23/helm-diff/releases/download/v3.0.0-rc.7/helm-diff-\u001b[01;31m\u001b[Kmacos\u001b[m\u001b[K.tgz",
        "                                                                                 ^",
        "Error: Failed to update plugin diff, got error (plugin update hook for \"diff\" exited with error)"
    ],
    "stdout":"Downloading https://github.com/databus23/helm-diff/releases/download/v3.0.0-rc.7/helm-diff-\u001b[01;31m\u001b[Kmacos\u001b[m\u001b[K.tgz\nFailed to install helm-diff\n\\tFor support, go to https://github.com/databus23/helm-diff.",
    "stdout_lines":[ 
        "Downloading https://github.com/databus23/helm-diff/releases/download/v3.0.0-rc.7/helm-diff-\u001b[01;31m\u001b[Kmacos\u001b[m\u001b[K.tgz",
        "Failed to install helm-diff",
        "\\tFor support, go to https://github.com/databus23/helm-diff."
    ]
}

…auses issues when accessing the url with curl if GREP_COLOR is set to always.
@gabor-boros gabor-boros requested a review from databus23 January 21, 2020 11:32
@databus23
Copy link
Owner

Thanks!

@databus23 databus23 merged commit 21cd808 into databus23:master Feb 17, 2020
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.

2 participants