Skip to content

Commit f42d364

Browse files
fix: strip quarantine flag via cask preflight on install
Adds preflight block to Homebrew cask to automatically remove the quarantine attribute before app is moved to /Applications, preventing the "damaged" warning on macOS without requiring code signing. Also documents manual xattr fix in README for zip-based installs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 95a5744 commit f42d364

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

Casks/screen-cursor.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616

1717
app "Screen Cursor.app"
1818

19+
preflight do
20+
system_command "/usr/bin/xattr",
21+
args: ["-cr", "#{staged_path}/Screen Cursor.app"],
22+
sudo: false
23+
end
24+
1925
zap trash: "~/Library/Preferences/com.local.ScreenCursor.plist"
2026
end

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ VERSION := $(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString
1010
ZIP_NAME := Screen-Cursor-$(VERSION).zip
1111
ZIP_PATH := $(DIST_DIR)/$(ZIP_NAME)
1212

13-
.PHONY: all clean dist run icon
13+
.PHONY: all clean dist zip run icon
1414

1515
all: $(SOURCES) $(INFO_PLIST)
1616
mkdir -p "$(APP_BUNDLE)/Contents/MacOS" "$(APP_BUNDLE)/Contents/Resources"
1717
swiftc -O -target arm64-apple-macos13.0 -framework Cocoa -framework Carbon "$(SOURCES)" -o "$(EXECUTABLE)"
1818
cp "$(INFO_PLIST)" "$(APP_BUNDLE)/Contents/Info.plist"
1919
cp "Resources/AppIcon.icns" "$(APP_BUNDLE)/Contents/Resources/"
2020

21-
dist: clean all
21+
zip:
2222
mkdir -p "$(DIST_DIR)"
2323
ditto -c -k --keepParent "$(APP_BUNDLE)" "$(ZIP_PATH)"
2424
shasum -a 256 "$(ZIP_PATH)"
2525

26+
dist: clean all zip
27+
2628
run: all
2729
open "$(APP_BUNDLE)"
2830

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ brew tap mathiasconradt/screencursor https://github.com/mathiasconradt/screencur
4848
brew install --cask screen-cursor
4949
```
5050

51+
If you downloaded the zip manually and macOS says the app is damaged, run:
52+
53+
```sh
54+
xattr -cr "/Applications/Screen Cursor.app"
55+
```
56+
5157
Settings are saved with `UserDefaults`:
5258

5359
- Highlight enabled

0 commit comments

Comments
 (0)