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

rearrange, comments, more descriptive variable names #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash -e
version=$(curl -sS https://update.tabnine.com/version)
#
# Download the latest version of the TabNine binary for UNIX-like operating systems

# Determine client OS
case $(uname -s) in
"Darwin")
platform="apple-darwin"
Expand All @@ -10,11 +13,24 @@ case $(uname -s) in
esac
triple="$(uname -m)-$platform"

# Go to folder where this script lives
cd $(dirname $0)
path=$version/$triple/TabNine
if [ -f binaries/$path ]; then
exit

# Get latest binary version number from TabNine server
latest_binary_version=$(curl -sS https://update.tabnine.com/version)

# Declare latest binary path
binary_path=$latest_binary_version/$triple/TabNine

# Check if newest binary exist locally, if it doesn't then download it
if [ ! -f binaries/$binary_path ]; then

# Inform user that we're now downloading the latest version
echo "Downloading TabNine $latest_binary_version..."

# Download latest binary
curl -sS https://update.tabnine.com/$binary_path --create-dirs -o binaries/$binary_path

# Set executable permissions on binary
chmod +x binaries/$binary_path
fi
echo Downloading version $version
curl https://update.tabnine.com/$path --create-dirs -o binaries/$path
chmod +x binaries/$path