File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -euo pipefail
33
4- # === Setup SSI ===
5-
6- echo " Initializing installer..."
7- tmpdir=" $( mktemp -d) "
8- trap ' rm -rf "$tmpdir"' EXIT
9- cd " $tmpdir "
10- export PATH=" $tmpdir :$PATH "
11-
12- if command -v curl > /dev/null 2>&1 ; then
13- curl -fSsL https://github.com/DannyBen/ssi/releases/download/v0.1.4/ssi -o ssi
14- elif command -v wget > /dev/null 2>&1 ; then
15- wget -nv -O ssi https://github.com/DannyBen/ssi/releases/download/v0.1.4/ssi
16- else
17- echo " Error: please install wget or curl, then try again" >&2
18- exit 1
19- fi
20- chmod +x ssi
21-
22- # === Install ===
23-
4+ prepare_installer () {
5+ echo " Initializing installer..."
6+ SSI_VERSION=" 0.1.8"
7+
8+ # Set up tmp dir where all work is done
9+ tmpdir=" $( mktemp -d) "
10+ trap ' rm -rf "$tmpdir"' EXIT
11+ cd " $tmpdir "
12+ export PATH=" $tmpdir :$PATH "
13+
14+ # Download ssi if needed
15+ if ! command -v ssi > /dev/null 2>&1 || [ " $( ssi --version 2> /dev/null) " != " $SSI_VERSION " ]; then
16+ if command -v curl > /dev/null 2>&1 ; then
17+ curl -fSsL https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION /ssi -o ssi
18+ elif command -v wget > /dev/null 2>&1 ; then
19+ wget -nv -O ssi https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION /ssi
20+ else
21+ echo " Error: please install wget or curl, then try again" >&2
22+ exit 1
23+ fi
24+ chmod +x ssi
25+ fi
26+ }
27+
28+ prepare_installer
2429ssi log info " Installing fuzzycd"
2530ssi install bin https://github.com/DannyBen/fuzzycd/releases/latest/download/fuzzycd
2631
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -euo pipefail
33
4- # === Setup SSI ===
4+ prepare_installer () {
5+ echo " Initializing installer..."
6+ SSI_VERSION=" 0.1.8"
57
6- echo " Initializing installer... "
7- tmpdir=" $( mktemp -d) "
8- trap ' rm -rf "$tmpdir"' EXIT
9- cd " $tmpdir "
10- export PATH=" $tmpdir :$PATH "
8+ # Set up tmp dir where all work is done
9+ tmpdir=" $( mktemp -d) "
10+ trap ' rm -rf "$tmpdir"' EXIT
11+ cd " $tmpdir "
12+ export PATH=" $tmpdir :$PATH "
1113
12- if command -v curl > /dev/null 2>&1 ; then
13- curl -fSsL https://github.com/DannyBen/ssi/releases/download/v0.1.4/ssi -o ssi
14- elif command -v wget > /dev/null 2>&1 ; then
15- wget -nv -O ssi https://github.com/DannyBen/ssi/releases/download/v0.1.4/ssi
16- else
17- echo " Error: please install wget or curl, then try again" >&2
18- exit 1
19- fi
20- chmod +x ssi
14+ # Download ssi if needed
15+ if ! command -v ssi > /dev/null 2>&1 || [ " $( ssi --version 2> /dev/null) " != " $SSI_VERSION " ]; then
16+ if command -v curl > /dev/null 2>&1 ; then
17+ curl -fSsL https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION /ssi -o ssi
18+ elif command -v wget > /dev/null 2>&1 ; then
19+ wget -nv -O ssi https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION /ssi
20+ else
21+ echo " Error: please install wget or curl, then try again" >&2
22+ exit 1
23+ fi
24+ chmod +x ssi
25+ fi
26+ }
2127
22- # === Uninstall ===
28+ prepare_installer
2329
2430ssi log info " Uninstalling fuzzycd"
2531ssi uninstall bin fuzzycd
You can’t perform that action at this time.
0 commit comments