Updates to scanner with CVE saving and auto update
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/zsh
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
SOURCE="$ROOT/PHPGuard/Assets.xcassets/AppIcon.appiconset/icon-1024.png"
|
||||
|
||||
[[ -f "$SOURCE" ]] || {
|
||||
echo "Missing PHPGuard icon: $SOURCE" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
APP="${1:?Pass the path to PHPGuard.app}"
|
||||
RESOURCES="$APP/Contents/Resources"
|
||||
|
||||
mkdir -p "$RESOURCES"
|
||||
|
||||
ICONSET="$(mktemp -d)/PHPGuard.iconset"
|
||||
mkdir -p "$ICONSET"
|
||||
|
||||
for size in 16 32 128 256 512; do
|
||||
sips -s format png -z "$size" "$size" "$SOURCE" \
|
||||
--out "$ICONSET/icon_${size}x${size}.png" >/dev/null
|
||||
|
||||
double=$((size * 2))
|
||||
|
||||
sips -s format png -z "$double" "$double" "$SOURCE" \
|
||||
--out "$ICONSET/icon_${size}x${size}@2x.png" >/dev/null
|
||||
done
|
||||
|
||||
iconutil -c icns "$ICONSET" -o "$RESOURCES/PHPGuard.icns"
|
||||
|
||||
/usr/libexec/PlistBuddy \
|
||||
-c "Delete :CFBundleIconFile" \
|
||||
"$APP/Contents/Info.plist" 2>/dev/null || true
|
||||
|
||||
/usr/libexec/PlistBuddy \
|
||||
-c "Add :CFBundleIconFile string PHPGuard.icns" \
|
||||
"$APP/Contents/Info.plist"
|
||||
|
||||
echo "PHPGuard application icon installed."
|
||||
Reference in New Issue
Block a user