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

Request adding a static "lastest" version single file download link #116

Open
samej71 opened this issue Sep 23, 2019 · 6 comments
Open

Request adding a static "lastest" version single file download link #116

samej71 opened this issue Sep 23, 2019 · 6 comments
Assignees

Comments

@samej71
Copy link

samej71 commented Sep 23, 2019

Right now it is possible to download the current (3.1.1.) version of the single-file ack using the following URL:
https://beyondgrep.com/ack-v3.1.1
and in a similar fashion, older versions can be downloaded, too, such as:
https://beyondgrep.com/ack-v3.1.0

Please consider adding a static URL such as
https://beyondgrep.com/ack-latest
that always points to the latest version, no matter what version that might be, so it can be coded into an install script knowing it will grab the latest version. So today, that URL would server up the 3.1.1 version, but when the next version is released, it will then point to whatever that newer version is.

Thank you for ack and for considering adding this feature to the website.

@petdance
Copy link
Collaborator

Would ack-latest download it directly, or would it redirect to ack-v3.whatever?

@samej71
Copy link
Author

samej71 commented Sep 23, 2019

It would cause less complications for users of the link if it directly served the file vs. a redirect.

For example, curl needs the -L parameter to follow the redirect and would require it to be added to your example install line:
curl -L https://beyondgrep.com/ack-latest > ~/bin/ack && chmod 0755 ~/bin/ack

Overall, though, I think you can choose what works best for you as far as automating your deployments.

@petdance
Copy link
Collaborator

coded into an install script knowing it will grab the latest version.

Tell me more about this install script you're thinking of. When does it get used?

@samej71
Copy link
Author

samej71 commented Sep 23, 2019

For me, my installer is in my dotfiles repository setup. Any time I spin up a new linux VM, I clone the git project and execute my setup script, which sets up my bash environment and installs git submodules and installs other external tools (like ack) to my liking so I have a single environment with all my preferences everywhere I go with only a git clone <mydotfilereposurl> followed by a ./dotfiles/setup.

@petdance petdance self-assigned this Oct 22, 2019
@unclefreddie70
Copy link

Hi,

Hoping someone may find this useful; I parse the changelog to figure out the latest version.

LOCALVERSION=$(/opt/foo/bin/ack --version | head -1 | awk '{ print $2 }')
REMOTEVERSION=$(curl https://beyondgrep.com/changes.txt | grep -E '^v.* (CDT|CST) ' | head -1 | awk '{ print $1 }')

if [[ $LOCALVERSION != $REMOTEVERSION ]]; then
	curl -L https://beyondgrep.com/ack-${REMOTEVERSION} -o /opt/foo/bin/ack
	chmod 755 /opt/foo/bin/ack
fi

@petdance
Copy link
Collaborator

Just FYI, an easier way to do

grep -E '^v.* (CDT|CST) ' | head -1 | awk '{ print $1 }'

with ack would be

ack '^(v\S+).+ C[DS]T' -1 --output='$1'

I know, you're trying to install ack and so don't have ack handy. I just wanted to point out some handy ack features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants