Last active
April 16, 2026 21:59
-
-
Save tofrankie/63378b9ba2c3d4393223feb0de1e0ac9 to your computer and use it in GitHub Desktop.
Fix Sourcetree icon on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # From: https://jira.atlassian.com/browse/SRCTREE-8221 | |
| # Go to the current user's Downloads directory | |
| cd ~/Downloads | |
| # Download a copy of the previous version of Sourcetree | |
| curl -LO 'https://product-downloads.atlassian.com/software/sourcetree/ga/Sourcetree_4.2.16_307.zip' | |
| # Unpack and remove the Zip archive | |
| unzip -q ./Sourcetree_4.2.16_307.zip && rm ./Sourcetree_4.2.16_307.zip | |
| # Generate a new Finder icon file from the old Sourcetree icon | |
| # Rez will exit with an error but still write the resource fork | |
| echo "read 'icns' (-16455) \"./Sourcetree.app/Contents/Resources/sourcetree.icns\";" | \ | |
| { Rez -o "$(printf '/Applications/Sourcetree.app/Icon\r')" 2>/dev/null || true ; } | |
| # Set the Finder's Custom icon flag on the application | |
| SetFile -a C /Applications/Sourcetree.app | |
| # Clean up the downloaded copy of Sourcetree | |
| rm -rf ./Sourcetree.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment