forked from johannesjo/parallel-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (46 loc) · 1.61 KB
/
install.sh
File metadata and controls
executable file
·61 lines (46 loc) · 1.61 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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
OS="$(uname -s)"
cd "$SCRIPT_DIR"
case "$OS" in
Darwin)
echo "Building release for macOS..."
rm -f "$SCRIPT_DIR"/release/*.dmg
npm run build:frontend && npm run compile && npx electron-builder --config.mac.identity=null
DMG_FILE=$(find "$SCRIPT_DIR/release" -name '*.dmg' -type f | head -1)
if [ -z "$DMG_FILE" ]; then
echo "Error: no .dmg found in release/"
exit 1
fi
echo "Mounting $DMG_FILE..."
MOUNT_DIR=$(hdiutil attach "$DMG_FILE" -nobrowse | tail -1 | sed 's/.*[[:space:]]\/Volumes/\/Volumes/')
APP_FILE=$(find "$MOUNT_DIR" -name '*.app' -maxdepth 1 | head -1)
if [ -z "$APP_FILE" ]; then
echo "Error: no .app found in mounted DMG"
hdiutil detach "$MOUNT_DIR"
exit 1
fi
echo "Installing to /Applications..."
cp -R "$APP_FILE" /Applications/
hdiutil detach "$MOUNT_DIR"
echo "Installed successfully to /Applications/"
;;
Linux)
echo "Building release for Linux..."
rm -f "$SCRIPT_DIR"/release/*.deb
npm run build
DEB_FILE=$(find "$SCRIPT_DIR/release" -name '*.deb' -type f | head -1)
if [ -z "$DEB_FILE" ]; then
echo "Error: no .deb found in release/"
exit 1
fi
echo "Installing $DEB_FILE..."
sudo dpkg -i "$DEB_FILE"
echo "Installed successfully via dpkg"
;;
*)
echo "Error: unsupported OS '$OS'"
exit 1
;;
esac