get.porter.sh/porter@v1.3.0/scripts/install/install-linux.sh (about)

     1  #!/usr/bin/env bash
     2  set -euo pipefail
     3  
     4  # Installs the porter CLI for a single user.
     5  # PORTER_HOME:        Location where Porter is installed (defaults to ~/.porter).
     6  # PORTER_MIRROR:      Base URL where Porter assets, such as binaries and atom feeds, are downloaded.
     7  #                     This lets you setup an internal mirror.
     8  # PORTER_VERSION:     The version of Porter assets to download.
     9  # PORTER_BINARY_URL:  The URL to porter binary (https:// or file:// for local binary)
    10  
    11  export PORTER_HOME=${PORTER_HOME:-~/.porter}
    12  export PORTER_MIRROR=${PORTER_MIRROR:-https://cdn.porter.sh}
    13  PORTER_VERSION=${PORTER_VERSION:-latest}
    14  PORTER_BINARY_URL=${PORTER_BINARY_URL:-"$PORTER_MIRROR/$PORTER_VERSION/porter-linux-amd64"}
    15  
    16  echo "Installing porter@$PORTER_VERSION to $PORTER_HOME from $PORTER_BINARY_URL"
    17  
    18  mkdir -p "$PORTER_HOME/runtimes"
    19  
    20  curl -fsSLo "$PORTER_HOME/porter" "$PORTER_BINARY_URL"
    21  chmod +x "$PORTER_HOME/porter"
    22  cp "$PORTER_HOME/porter" "$PORTER_HOME/runtimes/porter-runtime"
    23  echo Installed "$("$PORTER_HOME"/porter version)"
    24  
    25  "$PORTER_HOME/porter" mixin install exec --version "$PORTER_VERSION"
    26  
    27  echo "Installation complete."
    28  echo "Add porter to your path by adding the following line to your ~/.profile and open a new terminal:"
    29  echo "export PATH=\$PATH:~/.porter"