34 lines
1.5 KiB
Bash
Executable file
34 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Install SilverBullet.app into ~/Applications (magikoopa). No Freigabe (user home).
|
|
set -euo pipefail
|
|
SRC="$(cd "$(dirname "$0")" && pwd)/SilverBullet.app"
|
|
DEST="${HOME}/Applications/SilverBullet.app"
|
|
URL="${HOME}/Desktop/SilverBullet.url"
|
|
mkdir -p "${HOME}/Applications" "${HOME}/Desktop"
|
|
if [[ -d "$SRC" ]]; then
|
|
rm -rf "$DEST"
|
|
cp -R "$SRC" "$DEST"
|
|
else
|
|
# bootstrap minimal app if scaffold app tree missing
|
|
mkdir -p "$DEST/Contents/MacOS" "$DEST/Contents/Resources"
|
|
cat >"$DEST/Contents/Info.plist" <<'PLIST'
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>CFBundleName</key><string>SilverBullet</string>
|
|
<key>CFBundleDisplayName</key><string>SilverBullet</string>
|
|
<key>CFBundleIdentifier</key><string>ch.hacktivism.silverbullet</string>
|
|
<key>CFBundleVersion</key><string>1</string>
|
|
<key>CFBundleShortVersionString</key><string>1.0</string>
|
|
<key>CFBundleExecutable</key><string>SilverBullet</string>
|
|
<key>CFBundlePackageType</key><string>APPL</string>
|
|
<key>LSMinimumSystemVersion</key><string>12.0</string>
|
|
</dict>
|
|
</plist>
|
|
PLIST
|
|
printf '%s\n' '#!/bin/bash' 'open "https://silverbullet.hacktivism.ch/"' >"$DEST/Contents/MacOS/SilverBullet"
|
|
chmod +x "$DEST/Contents/MacOS/SilverBullet"
|
|
fi
|
|
printf '%s\n' '[InternetShortcut]' 'URL=https://silverbullet.hacktivism.ch/' >"$URL"
|
|
echo "STATUS=ok APP=$DEST URL=$URL"
|