Skip to content

Commit 7272b4b

Browse files
committed
Update install script to take in the version
1 parent 052d270 commit 7272b4b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ Just a basic script runner to easily abort/continue on previous step failure
77

88
#### Install on linux with curl script
99

10-
Ensure first that the `MY_OS` and `MY_ARCH` variables suit your system. The script does not validate the arguments but just print out a probable list.
10+
Ensure first that the `MY_OS`, `MY_ARCH` and `VER` variables suit your system. The script does not validate the arguments but just print out a probable list.
1111

1212
This list is directly based on the available download files found here: https://github.com/golang-devops/yaml-script-runner/releases/latest.
1313

1414

1515
```
1616
MY_OS=linux
1717
MY_ARCH=amd64
18-
curl -s https://raw.githubusercontent.com/golang-devops/yaml-script-runner/master/_scripts/install.sh | sudo bash /dev/stdin $MY_OS $MY_ARCH
18+
VER=v0.4
19+
curl -s https://raw.githubusercontent.com/golang-devops/yaml-script-runner/master/_scripts/install.sh | sudo bash /dev/stdin $VER $MY_OS $MY_ARCH
1920
```
2021

2122
#### Install from source (golang must be installed)

_scripts/install.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh
22

3-
VERSION=v0.3
43
allowed_os=( "darwin" "freebsd" "linux" "netbsd" "openbsd" )
54
allowed_arch=( "386" "amd64" )
65

7-
os=$1
8-
arch=$2
6+
version=$1
7+
os=$2
8+
arch=$3
99

1010
## Do not validate for now, otherwise we might prevent a download that actually exists if this script is old
1111
# valid_os=0
@@ -41,9 +41,9 @@ echo Probable list of ARCH is ${allowed_arch[@]}
4141
echo For a full list of supported OS-ARCH look at list in https://github.com/golang-devops/yaml-script-runner/releases/latest
4242

4343
echo Your input OS = "$os" and ARCH = "$arch"
44-
echo This is an install script for yaml-script-runner version $VERSION
44+
echo This is an install script for yaml-script-runner version $version
4545

46-
URL=https://github.com/golang-devops/yaml-script-runner/releases/download/$VERSION/$os_$arch_yaml-script-runner
46+
URL=https://github.com/golang-devops/yaml-script-runner/releases/download/$version/$os_$arch_yaml-script-runner
4747

4848
echo Now fetching binary at url $URL
4949
wget $URL -O /usr/local/bin/yaml-script-runner

0 commit comments

Comments
 (0)