-
Notifications
You must be signed in to change notification settings - Fork 605
Description
The Keybase label is not working due to comments in the HTML causing downloadURL to return extraneous, invalid data
The current variable:
downloadURL=$(curl -s https://keybase.io/docs/the_app/install_macos | grep data-target | cut -d '"' -f2
results in the downloadURL value being:
https://prerelease.keybase.io/Keybase.dmg https://prerelease.keybase.io/Keybase-arm64.dmg
Below are the relevant sections of HTML, first the correct line:
data-target="https://prerelease.keybase.io/Keybase.dmg"
But also this commented out section, that contains the second, invalid "data-target" (I deliberately broke the opening a href tag here so github won't render the HTML):
`<!-- TODO(ZCLIENT-3927) re-enable
< a
href="#_"
data-use-direct="true"
data-target="https://prerelease.keybase.io/Keybase-arm64.dmg"
data-platform="macOS (arm64)"
data-context="install-page"
class="install-link"
>Keybase.dmg (arm64)
} -->`
An easy patch would be to modify the downloadURL variable to only grab the first data-target found:
downloadURL=$(curl -s https://keybase.io/docs/the_app/install_macos | grep data-target | cut -d '"' -f2 | head -1
Thoughts?