Skip to content

Commit 0e1ade7

Browse files
committed
feat(terminal): Add ec installer
Signed-off-by: Mateusz Łoskot <[email protected]>
1 parent 1df9da1 commit 0e1ade7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

install/terminal/app-ec.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
SCRIPT_NAME="${BASH_SOURCE[0]}"
3+
SCRIPT_PATH="$(dirname "$(realpath "${SCRIPT_NAME}")")"
4+
source "${SCRIPT_PATH}/../../err.sh" "${SCRIPT_NAME}"
5+
source "${SCRIPT_PATH}/../../log.sh" "${SCRIPT_NAME}"
6+
7+
echolog "Installing ec"
8+
9+
VERSION=$(curl -s "https://api.github.com/repos/chojs23/ec/releases/latest" | grep -Po '"tag_name":\s*"v?\K[0-9.]+')
10+
echolog "Downloading ec ${VERSION}"
11+
12+
curl -LO https://github.com/chojs23/ec/releases/latest/download/ec-linux-amd64
13+
mv -f ./ec-linux-amd64 ~/.local/bin/ec
14+
chmod +x ~/.local/bin/ec
15+
16+
installed_cmd="$(command -v ec)"
17+
installed_ver="$(ec --version)"
18+
echolog "Installed ${installed_cmd} ${installed_ver}"

0 commit comments

Comments
 (0)