CLI/TUI for drafting, repeating, and publishing daily standup updates as GitHub issues
github go cli golang management project tui daily
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(scripts): add curl-based install script

+116
+116
scripts/install.sh
··· 1 + #!/bin/sh 2 + # pad installer script 3 + # Usage: curl -fsSL https://raw.githubusercontent.com/prefapp/pad/main/scripts/install.sh | sh 4 + 5 + set -e 6 + 7 + REPO="prefapp/pad" 8 + INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}" 9 + 10 + # Detect OS and architecture 11 + OS=$(uname -s) 12 + ARCH=$(uname -m) 13 + 14 + case "$OS" in 15 + Linux) 16 + GOOS="Linux" 17 + ;; 18 + Darwin) 19 + GOOS="Darwin" 20 + ;; 21 + CYGWIN*|MINGW*|MSYS*) 22 + GOOS="Windows" 23 + ;; 24 + *) 25 + echo "Error: Unsupported operating system: $OS" >&2 26 + exit 1 27 + ;; 28 + esac 29 + 30 + case "$ARCH" in 31 + x86_64|amd64) 32 + GOARCH="x86_64" 33 + ;; 34 + arm64|aarch64) 35 + GOARCH="arm64" 36 + ;; 37 + *) 38 + echo "Error: Unsupported architecture: $ARCH" >&2 39 + exit 1 40 + ;; 41 + esac 42 + 43 + # Get latest release version 44 + echo "Fetching latest release..." 45 + LATEST=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') 46 + 47 + if [ -z "$LATEST" ]; then 48 + echo "Error: Could not determine latest release" >&2 49 + exit 1 50 + fi 51 + 52 + echo "Latest version: $LATEST" 53 + 54 + # Create temp directory 55 + TMP_DIR=$(mktemp -d) 56 + trap "rm -rf $TMP_DIR" EXIT 57 + 58 + # Download release 59 + echo "Downloading pad for $GOOS/$GOARCH..." 60 + DOWNLOAD_URL="https://github.com/$REPO/releases/download/$LATEST/pad_${GOOS}_${GOARCH}.tar.gz" 61 + 62 + if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/pad.tar.gz"; then 63 + echo "Error: Failed to download $DOWNLOAD_URL" >&2 64 + exit 1 65 + fi 66 + 67 + # Extract 68 + echo "Extracting..." 69 + tar -xzf "$TMP_DIR/pad.tar.gz" -C "$TMP_DIR" 70 + 71 + # Create install directory if needed 72 + if [ ! -d "$INSTALL_DIR" ]; then 73 + echo "Creating $INSTALL_DIR..." 74 + mkdir -p "$INSTALL_DIR" 75 + fi 76 + 77 + # Check if directory is in PATH 78 + case ":$PATH:" in 79 + *":$INSTALL_DIR:"*|*":${INSTALL_DIR}/:"*) 80 + # Directory is in PATH 81 + ;; 82 + *) 83 + echo "" 84 + echo "Warning: $INSTALL_DIR is not in your PATH." 85 + echo "Add this to your shell profile:" 86 + echo " export PATH=\"$INSTALL_DIR:\$PATH\"" 87 + echo "" 88 + ;; 89 + esac 90 + 91 + # Install binary 92 + echo "Installing to $INSTALL_DIR/pad..." 93 + if [ -w "$INSTALL_DIR" ]; then 94 + mv "$TMP_DIR/pad" "$INSTALL_DIR/pad" 95 + chmod +x "$INSTALL_DIR/pad" 96 + else 97 + echo "Need sudo access to install to $INSTALL_DIR" 98 + sudo mv "$TMP_DIR/pad" "$INSTALL_DIR/pad" 99 + sudo chmod +x "$INSTALL_DIR/pad" 100 + fi 101 + 102 + # Verify installation 103 + if command -v pad >/dev/null 2>&1; then 104 + INSTALLED_VERSION=$(pad --version) 105 + echo "" 106 + echo "✓ pad $INSTALLED_VERSION installed successfully!" 107 + echo "" 108 + echo "Get started with:" 109 + echo " pad init" 110 + else 111 + echo "" 112 + echo "✓ pad installed to $INSTALL_DIR/pad" 113 + echo "" 114 + echo "Make sure $INSTALL_DIR is in your PATH, then run:" 115 + echo " pad init" 116 + fi