Skip to content

Instantly share code, notes, and snippets.

@brandondrew
Created December 30, 2016 20:04
Show Gist options
  • Save brandondrew/b0ec7e72af91a07f5e5fbfc672b6db05 to your computer and use it in GitHub Desktop.
Save brandondrew/b0ec7e72af91a07f5e5fbfc672b6db05 to your computer and use it in GitHub Desktop.
Easily install the Platinum Searcher (on Linux) (to your personal bin directory)
#!/usr/bin/env bash
OS_CODE="linux_amd64"
# TODO: check the OS and architecture and make this work across platforms
VERSION="v2.1.5"
# TODO: scrape the GitHub README for the latest version
TARGET=~/bin
# TODO: accept command line options, and prompt if nothing is specified
mkdir /tmp/pt # TODO: do this the fancy "right" way ;p
cd /tmp/pt
wget https://github.com/monochromegane/the_platinum_searcher/releases/download/${VERSION}/pt_${OS_CODE}.tar.gz
tar -xzf pt_${OS_CODE}.tar.gz
rm pt_${OS_CODE}.tar.gz
cp pt_${OS_CODE}/pt $TARGET
rm -rf pt_${OS_CODE}
@brandondrew
Copy link
Author

If you want to live dangerously, you can just

curl https://gist.githubusercontent.com/brandondrew/b0ec7e72af91a07f5e5fbfc672b6db05/raw/0df41f819358a3e968a2622a1531f3a4c4bec28b/install-pt | bash

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