-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
102 lines (88 loc) · 2.01 KB
/
install.sh
File metadata and controls
102 lines (88 loc) · 2.01 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Dockflow CLI Installer
# Usage: curl -fsSL https://raw.githubusercontent.com/Shawiizz/dockflow/main/install.sh | bash
set -e
# Version to install
VERSION="2.0.23"
# Detect OS and architecture
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
case "$OS" in
linux*)
OS="linux"
;;
darwin*)
OS="macos"
;;
mingw* | msys* | cygwin*)
OS="windows"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
case "$ARCH" in
x86_64 | amd64)
ARCH="x64"
;;
aarch64 | arm64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Build download URL
BINARY_NAME="dockflow-${OS}-${ARCH}"
if [ "$OS" = "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
if [ "$VERSION" = "latest" ]; then
DOWNLOAD_URL="https://github.com/Shawiizz/dockflow/releases/latest/download/${BINARY_NAME}"
else
DOWNLOAD_URL="https://github.com/Shawiizz/dockflow/releases/download/${VERSION}/${BINARY_NAME}"
fi
# Determine install location
if [ "$OS" = "windows" ]; then
INSTALL_DIR="$HOME/bin"
INSTALL_PATH="$INSTALL_DIR/dockflow.exe"
else
if [ -w "/usr/local/bin" ]; then
INSTALL_DIR="/usr/local/bin"
else
INSTALL_DIR="$HOME/.local/bin"
fi
INSTALL_PATH="$INSTALL_DIR/dockflow"
fi
# Create install directory if needed
mkdir -p "$INSTALL_DIR"
echo "Downloading Dockflow CLI..."
echo " Version: $VERSION"
echo " Platform: $OS-$ARCH"
echo " URL: $DOWNLOAD_URL"
echo ""
# Download
if command -v curl &>/dev/null; then
curl -fsSL "$DOWNLOAD_URL" -o "$INSTALL_PATH"
elif command -v wget &>/dev/null; then
wget -q "$DOWNLOAD_URL" -O "$INSTALL_PATH"
else
echo "Error: curl or wget is required"
exit 1
fi
# Make executable
chmod +x "$INSTALL_PATH"
echo "✓ Dockflow CLI installed to $INSTALL_PATH"
echo ""
# Check if in PATH
if ! command -v dockflow &>/dev/null; then
echo "Note: Add $INSTALL_DIR to your PATH:"
if [ "$OS" = "linux" ] || [ "$OS" = "macos" ]; then
echo " echo 'export PATH=\"$INSTALL_DIR:\$PATH\"' >> ~/.bashrc"
echo " source ~/.bashrc"
fi
fi
echo ""
echo "Run 'dockflow --help' to get started"