-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·48 lines (37 loc) · 1.32 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·48 lines (37 loc) · 1.32 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
#!/bin/bash
# FileGenius Installer
# https://github.com/danielalanbates/file-organizer-macos
set -e
REPO="danielalanbates/file-organizer-macos"
APP_NAME="FileGenius"
echo "📁 Installing $APP_NAME..."
echo ""
# Get latest release download URL
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep "browser_download_url.*\.dmg" | cut -d '"' -f 4)
if [ -z "$DOWNLOAD_URL" ]; then
echo "❌ Could not find latest release. Please download manually from:"
echo " https://github.com/$REPO/releases"
exit 1
fi
# Create temp directory
TEMP_DIR=$(mktemp -d)
DMG_PATH="$TEMP_DIR/FileGenius.dmg"
echo "📥 Downloading latest release..."
curl -L -o "$DMG_PATH" "$DOWNLOAD_URL"
echo "📦 Mounting disk image..."
MOUNT_POINT=$(hdiutil attach "$DMG_PATH" -nobrowse | grep "/Volumes" | awk '{print $3}')
echo "🚀 Installing to /Applications..."
cp -R "$MOUNT_POINT"/*.app /Applications/ 2>/dev/null || {
echo "❌ Could not copy app. You may need to run with sudo."
hdiutil detach "$MOUNT_POINT" -quiet
rm -rf "$TEMP_DIR"
exit 1
}
echo "🧹 Cleaning up..."
hdiutil detach "$MOUNT_POINT" -quiet
rm -rf "$TEMP_DIR"
echo ""
echo "✅ $APP_NAME installed successfully!"
echo "📍 Location: /Applications/"
echo ""
echo "To run: Open '$APP_NAME' from your Applications folder or Spotlight."