homebrew-cask/Casks/sourcetree.rb

45 lines
1.5 KiB
Ruby
Raw Normal View History

2015-12-18 09:15:28 +08:00
cask 'sourcetree' do
2014-12-11 00:55:21 +08:00
if MacOS.release <= :snow_leopard
2014-12-07 14:11:58 +08:00
version '1.8.1'
sha256 '37a42f2d83940cc7e1fbd573a70c3c74a44134c956ac3305f6b153935dc01b80'
elsif MacOS.release <= :mountain_lion
version '2.0.5.5'
sha256 'f23129587703a706a37d5fdd9b2390875305b482a2b4e4b0e34bd49cba9b63c9'
2014-12-07 14:11:58 +08:00
else
2016-05-11 08:12:28 +08:00
version '2.3'
sha256 '944ea6157c76c10b6745e26d2531235e34fd8f400cbdc71818045583b3adf13c'
2014-12-07 14:11:58 +08:00
end
2016-03-09 05:03:58 +08:00
# atlassian.com was verified as official when first introduced to the cask
2016-05-11 08:12:28 +08:00
url "https://downloads.atlassian.com/software/sourcetree/SourceTree_#{version}.zip"
2015-06-02 00:53:02 +08:00
appcast 'https://www.sourcetreeapp.com/update/SparkleAppcast.xml',
2016-03-25 06:21:56 +08:00
checkpoint: '281824c0f503c7db534e0ba7684606ab2e3810787154f91096bcf203d344596b'
name 'Atlassian SourceTree'
2015-06-02 00:53:02 +08:00
homepage 'https://www.sourcetreeapp.com/'
license :gratis
2016-02-10 07:32:42 +08:00
auto_updates true
2014-09-16 00:06:22 +08:00
app 'SourceTree.app'
[WIP] Change artifact behavior to moving instead of symlinking (#13966) * Change app artifact to move instead of link First step towards change in installation behavior mentioned in [13201] * Fix handling of binaries linked from inside of app bundles Also adds `appdir` method for interpolation in stanzas * Change appdir to root Applications directory * Update 2-app tests * Refactor: add options, ivars to `Installer`, `Download` In preparation for upcoming changes, this commit cleans up some code. The commit includes: - In order to reduce unnecessary object passing, make both the `force` and `skip_cask_deps` option into instance variables of the `Installer` class - Introduce options hashes to initializers of both the `Installer` and `Download` class - When the `install --force` command enters the fetch phase, make it explicit in the code that fetching is never enforced in that case. - Update tests * Force overwrite artifacts on `--force` reinstall This commit changes the behavior of a `Moved` artifact such that if the target already exists, `brew cask install --force` will remove the existing target before moving the staged artifact. In that case, the warning message will say *overwriting* instead of *not moving*. The behavior of plain `brew cask install` remains unchanged; the same goes for the warning message for that case. * Change remaining artifacts to move instead of symlink * Update casks to use appdir in binary paths * Forcibly overwrite artifacts, modifying flags and using `sudo` if needed - This commit implements [the proposed behavior for `install --force`](https://github.com/caskroom/homebrew-cask/pull/13966#issuecomment-220830387) when a target already exists and has either permission problems or is not owned by the user. - The changes apply only when the `force` option is given. - Reused the existing safeguard from the `.pkg` artifact to prevent deleting important directories by bug or mistake - The two existing blacklists `SYSTEM_DIRS` and `UNDELETABLE_DIRS` have been consolidated into the `Hbc::MacOS` module. - `UNDELETABLE_DIRS` now also contains all the entries from `SYSTEM_DIRS` which was a to-do anyway. - The two blacklists are now also frozen for good measure. - The utility method `permissions_rmtree` was moved to `Hbc::Utils`. - The `tried_permissions` part in `Utils` now falls back correctly when there are also ownership issues at the same time. - Introduced a separate `current_user` method for mocking. - Added an optional feature to `FakeSystemCommand` so it can now act as a proxy to `SystemCommand`. - Added tests for various `permissions_rmtree` cases.
2016-06-01 03:23:21 +08:00
binary "#{appdir}/SourceTree.app/Contents/Resources/stree"
2014-10-11 22:34:04 +08:00
postflight do
suppress_move_to_applications
end
uninstall launchctl: 'com.atlassian.SourceTreePrivilegedHelper2',
quit: 'com.torusknot.SourceTreeNotMAS'
zap delete: [
'~/Library/Application Support/SourceTree',
'~/Library/Caches/com.torusknot.SourceTreeNotMAS',
'~/Library/Preferences/com.torusknot.SourceTreeNotMAS.plist',
'~/Library/Preferences/com.torusknot.SourceTreeNotMAS.LSSharedFileList.plist',
'~/Library/Saved Application State/com.torusknot.SourceTreeNotMAS.savedState',
]
2014-10-10 20:13:30 +08:00
caveats do
files_in_usr_local
end
2012-10-03 22:19:08 +08:00
end