-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.command
More file actions
executable file
·65 lines (57 loc) · 2.35 KB
/
Copy pathinstall.command
File metadata and controls
executable file
·65 lines (57 loc) · 2.35 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
62
63
64
65
#!/usr/bin/env bash
# install.command — double-clickable installer for the GitHub-release
# zip. Lives at the repo root, gets copied verbatim into the release
# zip by both `make release` (the signed pipeline used for stable
# tags from v0.2 onwards) and `make release-unsigned` (CI-driven for
# pre-release tags). For v0.1 this was the only install path; from
# v0.2 the Homebrew cask becomes a parallel option for users who
# prefer it (see release/notarisation/SIGNING.md).
#
# Idempotent: running it again replaces the already-installed bundle.
set -euo pipefail
cd "$(dirname "$0")"
PLUGIN="GmicFilter.plugin"
if [[ ! -d "$PLUGIN" ]]; then
echo "ERROR: $PLUGIN not found next to install.command." >&2
echo " Run this script from inside the unzipped release folder." >&2
exit 1
fi
# Strip Gatekeeper quarantine if it's been set (it will be on a zip the
# user downloaded via Safari/Chrome). xattr -dr is idempotent: if the
# attribute isn't there it just returns non-zero, which we swallow.
xattr -dr com.apple.quarantine "$PLUGIN" 2>/dev/null || true
# Affinity plugin folders we know about. Add new ones here as Affinity
# ships new versions; the script auto-skips any whose parent dir is
# absent (proxy for "this Affinity version is not installed").
TARGETS=(
"$HOME/Library/Application Support/Affinity Photo 2/Plugins"
"$HOME/Library/Application Support/Affinity/Plugins"
)
INSTALLED=0
for dir in "${TARGETS[@]}"; do
parent="$(dirname "$dir")"
if [[ -d "$parent" ]]; then
mkdir -p "$dir"
rm -rf "$dir/$PLUGIN"
cp -R "$PLUGIN" "$dir/"
echo "Installed: $dir/$PLUGIN"
INSTALLED=$((INSTALLED + 1))
fi
done
if [[ "$INSTALLED" -eq 0 ]]; then
echo "" >&2
echo "WARNING: no Affinity Photo install detected on this machine." >&2
echo "Tried:" >&2
for dir in "${TARGETS[@]}"; do
echo " - $dir" >&2
done
echo "Install Affinity Photo 2 or Affinity Photo v3 first, then re-run this script." >&2
exit 2
fi
echo ""
echo "Done. Restart Affinity Photo to pick up the new plugin."
echo "If Filters → Plugins → G'MIC does not appear, check:"
echo " - Affinity → Settings → Photoshop Plugins → 'Allow unknown plugins to be used' (must be ticked)"
echo " - The 'gmic' CLI is installed: brew install gmic"
echo " (G'MIC-Qt is not on Homebrew and is not needed for this plugin.)"
echo " - Logs: ~/Library/Logs/gmic-affinity.log"