forked from CypherGoat/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (49 loc) · 1.99 KB
/
install.sh
File metadata and controls
executable file
·62 lines (49 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -e
BIN_DIR="/usr/local/bin"
BINARY_NAME="cyphergoat"
REMOTE_URL="https://github.com/moralpriest/cyphergoat-cli/releases/download/v1"
TMP_DIR=$(mktemp -d)
TMP_FILE="${TMP_DIR}/${BINARY_NAME}"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
esac
case "$OS" in
cygwin*|mingw*|msys*) OS="windows" ;;
esac
if [ "$OS" = "windows" ]; then
ASSET_NAME="${BINARY_NAME}-${OS}-${ARCH}.exe"
else
ASSET_NAME="${BINARY_NAME}-${OS}-${ARCH}"
fi
echo "Installing CypherGoat CLI..."
echo "Platform: ${OS}-${ARCH}"
echo "Downloading CypherGoat CLI..."
curl -fsSL "${REMOTE_URL}/${ASSET_NAME}" -o "${TMP_FILE}"
chmod +x "${TMP_FILE}"
echo "Moving binary to ${BIN_DIR}..."
if [ -w "${BIN_DIR}" ]; then
mv "${TMP_FILE}" "${BIN_DIR}/${BINARY_NAME}"
rm -rf "${TMP_DIR}"
echo "CypherGoat CLI has been successfully installed!"
echo "Run '${BINARY_NAME}' to get started."
echo ""
echo "Verification (optional but recommended):"
echo " Easy: gh attestation verify \${BIN_DIR}/${BINARY_NAME} -R moralpriest/cyphergoat-cli"
echo " Cypherpunk: curl -fsSL https://raw.githubusercontent.com/moralpriest/cyphergoat-cli/main/.github/cyphergoat.pub > cyphergoat.pub"
echo " cosign verify --key cyphergoat.pub \${BIN_DIR}/${BINARY_NAME}"
else
echo "Elevated permissions required to install to ${BIN_DIR}"
sudo mv "${TMP_FILE}" "${BIN_DIR}/${BINARY_NAME}"
rm -rf "${TMP_DIR}"
echo "CypherGoat CLI has been successfully installed!"
echo "Run '${BINARY_NAME}' to get started."
echo ""
echo "Verification (optional but recommended):"
echo " Easy: gh attestation verify \${BIN_DIR}/${BINARY_NAME} -R moralpriest/cyphergoat-cli"
echo " Cypherpunk: curl -fsSL https://raw.githubusercontent.com/moralpriest/cyphergoat-cli/main/.github/cyphergoat.pub > cyphergoat.pub"
echo " cosign verify --key cyphergoat.pub \${BIN_DIR}/${BINARY_NAME}"
fi