Sha256: 94565e6e5cb4411071da69a389ced3e42823d5a00ec0a59cfd29a0e36177656a

Contents?: true

Size: 1.53 KB

Versions: 15

Compression:

Stored size: 1.53 KB

Contents

#!/bin/bash
{
    PACKAGE_URL="https://s3.amazonaws.com/quandl-command/quandl-command$1.tar.gz"
    PACKAGE_PATH="/usr/local/quandl"
    
    echo "Welcome to the Quandl Toolbelt."
    ruby -v >/dev/null 2>&1 || { echo -e >&2 "\033[0;31mI require ruby 1.9 but it's not installed.  Aborting.
    \033[0;33mapt-get install ruby1.9.1\033[0;29m"; exit 1; }
    echo "Superuser is required, you will be prompted for your password."
    
    # clear sudo
    sudo -k
    # run inside sudo
    sudo bash <<SCRIPT
  
  rm -rf "$PACKAGE_PATH.new"
  mkdir -p "$PACKAGE_PATH.new"
  cd "$PACKAGE_PATH.new"
  
  if [[ -z "$(which wget)" ]]; then
    curl -s $PACKAGE_URL | tar xz
  else
    wget -qO- $PACKAGE_URL | tar xz
  fi
  
  if [ -d "quandl-command" ]; then
    mv quandl-command/* .
    rmdir quandl-command
    rm -rf $PACKAGE_PATH
    mv "$PACKAGE_PATH.new" "$PACKAGE_PATH"
    sudo chown -R $USER:$GROUP $PACKAGE_PATH
  else
    echo -e "\033[0;33mWARNING: Revision $1 not found. \033[0;29m"
    rmdir "$PACKAGE_PATH.new"
  fi
SCRIPT
    # remind the user to add to $PATH
    if [[ ":$PATH:" != *":/usr/local/quandl/bin:"* ]]; then
      echo "----"
      echo -e "Installation is complete, but there is one more step you need to take."
      echo -e "\033[0;33mBefore you start using Quandl Toolbelt, you must type:  'source $HOME/.bash_profile'\033[0;29m"
      
      echo "
# Added by Quandl Toolbelt
PATH=\"/usr/local/quandl/bin:\$PATH\"" >> "$HOME/.bash_profile"
    else
      echo "----"
      echo -e "\033[0;32mInstallation complete!\033[0;29m"
    fi

}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
quandl-0.4.4 scripts/install.sh
quandl-0.4.3 scripts/install.sh
quandl-0.4.2 scripts/install.sh
quandl-0.4.1 scripts/install.sh
quandl-0.4.0 scripts/install.sh
quandl-0.3.7 scripts/install.sh
quandl-0.3.6 scripts/install.sh
quandl-0.3.4 scripts/install.sh
quandl-0.3.3 scripts/install.sh
quandl-0.3.0 scripts/install.sh
quandl-0.2.27 scripts/install.sh
quandl-0.2.26 scripts/install.sh
quandl-0.2.25 scripts/install.sh
quandl-0.2.24 scripts/install.sh
quandl-0.2.22 scripts/install.sh