feat: add Windows gitbash installation support and improve binary download process
This commit is contained in:
parent
faa7927376
commit
48781147cc
2 changed files with 56 additions and 4 deletions
21
install.sh
21
install.sh
|
|
@ -20,6 +20,7 @@ fi
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
Linux) OS="linux" ;;
|
Linux) OS="linux" ;;
|
||||||
Darwin) OS="darwin" ;;
|
Darwin) OS="darwin" ;;
|
||||||
|
MSYS_NT-10.0-26100) OS="windows" ;; # gitbash
|
||||||
*) echo "Unsupported OS: $OS"; exit 1 ;;
|
*) echo "Unsupported OS: $OS"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
@ -29,9 +30,23 @@ BINARY_URL="https://codeberg.org/headshed/infctl-cli/releases/download/$VERSION/
|
||||||
|
|
||||||
# Download the binary
|
# Download the binary
|
||||||
echo "Downloading infctl binary for $OS-$ARCH..."
|
echo "Downloading infctl binary for $OS-$ARCH..."
|
||||||
|
|
||||||
|
if [ "$OS" == "windows" ]; then
|
||||||
|
# Create ~/bin if it doesn't exist
|
||||||
|
mkdir -p "$HOME/bin"
|
||||||
|
curl -s -L "$BINARY_URL.exe" -o "$HOME/bin/infctl.exe"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to download infctl for Windows"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Ensure ~/bin is in PATH for future sessions
|
||||||
|
if ! grep -q 'export PATH="$HOME/bin:$PATH"' "$HOME/.bash_profile" 2>/dev/null; then
|
||||||
|
echo 'export PATH="$HOME/bin:$PATH"' >> "$HOME/.bash_profile"
|
||||||
|
echo "Added ~/bin to PATH in ~/.bash_profile. Please restart your shell or run: source ~/.bash_profile"
|
||||||
|
fi
|
||||||
|
else
|
||||||
sudo curl -s -L "$BINARY_URL" -o /usr/local/bin/infctl
|
sudo curl -s -L "$BINARY_URL" -o /usr/local/bin/infctl
|
||||||
|
|
||||||
# Make it executable
|
|
||||||
sudo chmod +x /usr/local/bin/infctl
|
sudo chmod +x /usr/local/bin/infctl
|
||||||
|
fi
|
||||||
|
|
||||||
echo "infctl installed successfully!"
|
echo "infctl install done."
|
||||||
|
|
|
||||||
37
vagrant/dev/ubuntu/tmp/inst.sh
Normal file
37
vagrant/dev/ubuntu/tmp/inst.sh
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Determine the platform
|
||||||
|
OS=$(uname -s)
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
|
# Map architecture
|
||||||
|
if [ "$ARCH" == "x86_64" ]; then
|
||||||
|
ARCH="amd64"
|
||||||
|
elif [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
|
||||||
|
ARCH="arm64"
|
||||||
|
else
|
||||||
|
echo "Unsupported architecture: $ARCH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Map OS
|
||||||
|
case "$OS" in
|
||||||
|
Linux) OS="linux" ;;
|
||||||
|
Darwin) OS="darwin" ;;
|
||||||
|
*) echo "Unsupported OS: $OS"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Construct the download URL
|
||||||
|
VERSION="v0.0.4"
|
||||||
|
BINARY_URL="https://codeberg.org/headshed/infctl-cli/releases/download/$VERSION/infctl-$OS-$ARCH"
|
||||||
|
|
||||||
|
# Download the binary
|
||||||
|
echo "Downloading infctl binary for $OS-$ARCH..."
|
||||||
|
sudo curl -s -L "$BINARY_URL" -o /usr/local/bin/infctl
|
||||||
|
|
||||||
|
# Make it executable
|
||||||
|
sudo chmod +x /usr/local/bin/infctl
|
||||||
|
|
||||||
|
echo "infctl installed successfully!"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue