-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
49 lines (40 loc) · 1.64 KB
/
Copy pathinstall.sh
File metadata and controls
49 lines (40 loc) · 1.64 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
#!/bin/bash
set -e
APP_NAME="cursorx"
PACKAGE_NAME="cursorscript"
INSTALL_ROOT="$HOME/.$PACKAGE_NAME"
BIN_LINK="/usr/local/bin/$APP_NAME"
# 0. Stop the application if it's currently running
if pgrep -x "$APP_NAME" > /dev/null; then
echo "🛑 Stopping running instance of $APP_NAME..."
pkill -x "$APP_NAME"
sleep 1 # Give the OS a moment to clean up the process
fi
# 1. Detect Arch/OS
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
[[ "$ARCH" == "x86_64" ]] && ARCH="x64"
[[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]] && ARCH="arm64"
TARGET="${PACKAGE_NAME}-${OS}-${ARCH}.zip"
URL="https://github.com/naveenpoddar/cursorscript/releases/latest/download/$TARGET"
# 1. Prepare Directory
if [ -d "$INSTALL_ROOT" ]; then
echo "�️ Removing existing $INSTALL_ROOT..."
rm -rf "$INSTALL_ROOT"
fi
mkdir -p "$INSTALL_ROOT"
echo "📦 Downloading $TARGET..."
curl -L "$URL" -o "$INSTALL_ROOT/package.zip"
# 2. Extract & Clean up
echo "📂 Extracting full bundle..."
unzip -o "$INSTALL_ROOT/package.zip" -d "$INSTALL_ROOT"
# This moves contents out of the subfolder 'cursorscript-linux-x64' into the root install dir
mv "$INSTALL_ROOT/${PACKAGE_NAME}-${OS}-${ARCH}/"* "$INSTALL_ROOT/"
rm -rf "$INSTALL_ROOT/${PACKAGE_NAME}-${OS}-${ARCH}" "$INSTALL_ROOT/package.zip"
# 3. Create Symlink (Requires sudo for /usr/local/bin, or use ~/.local/bin)
echo "🔗 Setting up PATH..."
chmod +x "$INSTALL_ROOT/cursorx"
# If you don't want to use sudo, change this to append to .zshrc/.bashrc instead
sudo ln -sf "$INSTALL_ROOT/cursorx" "$BIN_LINK"
echo "✅ Installed! The app and its /lib are at $INSTALL_ROOT"
echo "🚀 Try running: $APP_NAME"