Skip to content

Commit

Permalink
Add one line install (#364)
Browse files Browse the repository at this point in the history
* add variable

* add readme install instructions

* add latest version

* add latest install instructions

* double quote cmd

* update install instructions

---------

Co-authored-by: Pedro Tashima <[email protected]>
  • Loading branch information
tashima42 and tashima42 authored Feb 15, 2024
1 parent 09bc29c commit d8ad00d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ The easiest way to install a single utility is to go to the release page, choose
To install all executables and shell libraries, run the install script as follows:

```sh
install.sh v0.24.0
# to install the latest version
curl -sfL https://raw.githubusercontent.com/rancher/ecm-distro-tools/master/install.sh | sh -
# or
./install.sh
# to install a specific version
curl -sfL https://raw.githubusercontent.com/rancher/ecm-distro-tools/master/install.sh | ECM_VERSION=v0.31.2 sh -
# or
./install.sh v0.31.2
```

This will download all binaries and shell libraries and install them to `/usr/local/bin/ecm-distro-tools`. You'll need to add that directory to your path after installation.
Expand Down
11 changes: 7 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ install_binaries() {
}

{ # main
if [ -z "$1" ]; then
echo "error: release version required"
exit 1
fi
RELEASE_VERSION=$1
if [ -n "${ECM_VERSION}" ]; then
RELEASE_VERSION=${ECM_VERSION}
fi

if [ -z "$RELEASE_VERSION" ]; then
RELEASE_VERSION=$(basename "$(curl -Ls -o /dev/null -w %\{url_effective\} https://github.com/rancher/ecm-distro-tools/releases/latest)")
fi

echo "Installing ECM Distro Tools: ${RELEASE_VERSION}"

Expand Down

0 comments on commit d8ad00d

Please sign in to comment.