Skip to content

Commit

Permalink
Merge pull request #6096 from rolandwalker/mass_change_preflight_post…
Browse files Browse the repository at this point in the history
…flight

Mass change: new preflight/postflight stanzas
  • Loading branch information
rolandwalker committed Sep 9, 2014
2 parents 6f4ef21 + e5ab35f commit 4594b47
Show file tree
Hide file tree
Showing 61 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion Casks/adobe-air.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AdobeAir < Cask

caskroom_only true

after_install do
postflight do
system '/usr/bin/sudo', '-E', '--',
"#{destination_path}/Adobe AIR Installer.app/Contents/MacOS/Adobe AIR Installer", '-silent'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/adobe-arh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AdobeArh < Cask
binary 'arh'
container_type :naked

after_install do
postflight do
system '/bin/chmod', '--', '755', "#{destination_path}/arh"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/alfred.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Alfred < Cask
link 'Alfred 2.app'
link 'Alfred 2.app/Contents/Preferences/Alfred Preferences.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.runningwithcrayons.alfred-2', 'suppressMoveToApplications', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/alib1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Alib1 < Cask

screen_saver 'Presstube-ALib1.app/Contents/Resources/Presstube - ALib1.saver'

after_install do
postflight do
system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName ALib1 (Presstube)', "#{destination_path}/presstube-alib1.app/Contents/Resources/Presstube - ALib1.saver/Contents/Info.plist"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/amazon-music.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AmazonMusic < Cask

caskroom_only true

after_install do
postflight do
system '/usr/bin/sudo', '-E', '--',
"#{destination_path}/Amazon Music Installer.app/Contents/MacOS/osx-intel"
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/android-studio-bundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AndroidStudioBundle < Cask

link 'Android Studio.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/Android Studio.app/Contents/Info.plist"
end
end
2 changes: 1 addition & 1 deletion Casks/android-studio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AndroidStudio < Cask

link 'Android Studio.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/Android Studio.app/Contents/Info.plist"
end
end
2 changes: 1 addition & 1 deletion Casks/appcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Appcode < Cask

link 'AppCode.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/AppCode.app/Contents/Info.plist"
end
end
2 changes: 1 addition & 1 deletion Casks/atom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Atom < Cask
link 'Atom.app'
binary 'Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm', :target => 'apm'
binary 'Atom.app/Contents/Resources/app/atom.sh', :target => 'atom'
after_install do
postflight do
system '/usr/bin/defaults', 'write', 'com.github.atom', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
end
2 changes: 1 addition & 1 deletion Casks/bankid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Bankid < Cask
homepage 'http://www.bankid.com/'

container_type :naked
before_install do
preflight do
system '/bin/mv', '--', destination_path.join('FileDownloader'), destination_path.join('bankid-latest.pkg')
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/bartender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Bartender < Cask

link 'Bartender.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.surteesstudios.Bartender', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/changes-meter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ChangesMeter < Cask
homepage 'http://intuiware.com/apps/changes-meter'

link 'Changes Meter.app'
after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system %Q{/usr/bin/defaults write com.intuiware.ChangesMeter moveToApplicationsFolderAlertSuppress -bool true}
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/cheatsheet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Cheatsheet < Cask

link 'CheatSheet.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.mediaatelier.CheatSheet', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/chunkulus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Chunkulus < Cask

screen_saver 'presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver'

after_install do
postflight do
system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName Chunkulus (Presstube)', "#{destination_path}/presstube-chunkulus.app/Contents/Resources/Presstube - Chunkulus.saver/Contents/Info.plist"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/clamxav.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Clamxav < Cask
homepage 'http://www.clamxav.com/'

link 'ClamXav.app'
after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'uk.co.markallan.clamxav', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/crosspack-avr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CrosspackAvr < Cask
homepage 'http://www.obdev.at/products/crosspack/'

install 'CrossPack-AVR.pkg'
after_uninstall do
uninstall_postflight do
IO.popen('/usr/bin/yes | /usr/bin/sudo -E -- /usr/local/CrossPack-AVR/uninstall && /usr/bin/sudo -- /usr/sbin/pkgutil --forget at.obdev.CrossPack-AVR', 'r+') do |pipe|
pipe.close_write
while line = pipe.gets
Expand Down
2 changes: 1 addition & 1 deletion Casks/daisydisk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Daisydisk < Cask

link 'DaisyDisk.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.daisydiskapp.DaisyDiskStandAlone', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/dash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Dash < Cask

link 'Dash.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.kapeli.dash', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/decitime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Decitime < Cask

# fix wonky DMG by mounting it once read-write per discussion at
# https://github.com/caskroom/homebrew-cask/pull/2654
before_install do
preflight do
system %Q{/usr/bin/hdiutil eject "$(/usr/bin/hdiutil mount -readwrite -noidme -nobrowse -mountrandom /tmp #{destination_path.join(artifacts[:nested_container].first)} | /usr/bin/cut -f3 -- - | /usr/bin/grep -- '.' -)" >/dev/null 2>&1}
end
end
2 changes: 1 addition & 1 deletion Casks/fantastical.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Fantastical < Cask

link 'Fantastical.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.flexibits.fantastical', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/flux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Flux < Cask

link 'Flux.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'org.herf.Flux', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/git-annex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class GitAnnex < Cask
url 'http://downloads.kitenet.net/git-annex/OSX/current/10.8.2_Mountain_Lion/git-annex.dmg.bz2'
# This is a horrible hack to force the file extension. The
# backend code should be fixed so that this is not needed.
before_install do
preflight do
system '/bin/mv', '--', destination_path.join('git-annex-latest'), destination_path.join('git-annex-latest.dmg')
end
nested_container 'git-annex-latest.dmg'
Expand Down
2 changes: 1 addition & 1 deletion Casks/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Github < Cask

link 'GitHub.app'
binary 'GitHub.app/Contents/MacOS/github_cli', :target => 'github'
after_install do
postflight do
system '/usr/bin/defaults', 'write', 'com.github.GitHub', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
end
4 changes: 2 additions & 2 deletions Casks/gpgtools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Gpgtools < Cask
homepage 'https://gpgtools.org/index.html'

install 'Install.pkg'
after_install do
postflight do
system '/usr/bin/sudo', '-E', '--',
'/usr/local/MacGPG2/libexec/fixGpgHome', Etc.getpwuid(Process.euid).name,
ENV['GNUPGHOME'] ? ENV['GNUPGHOME'] : "#{ENV['HOME']}/.gnupg"
Expand Down Expand Up @@ -35,7 +35,7 @@ class Gpgtools < Cask
'/Library/PreferencePanes/GPGPreferences.prefPane',
"ENV['HOME']/Library/PreferencePanes/GPGPreferences.prefPane",
]
after_uninstall do
uninstall_postflight do
system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg2)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg2'
system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg'
system '/bin/bash', '-c', '[[ "$(/usr/bin/readlink /usr/local/bin/gpg-agent)" =~ MacGPG2 ]] && /bin/rm -- /usr/local/bin/gpg-agent'
Expand Down
2 changes: 1 addition & 1 deletion Casks/heart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Heart < Cask

screen_saver 'presstube-heart.app/Contents/Resources/Presstube - Heart.saver'

after_install do
postflight do
system '/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleName Heart (Presstube)', "#{destination_path}/presstube-heart.app/Contents/Resources/Presstube - Heart.saver/Contents/Info.plist"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/hipchat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Hipchat < Cask

link 'HipChat.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.hipchat.HipChat', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/hive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Hive < Cask

link 'Hive.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.hivewallet.Hive', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/hockeyapp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Hockeyapp < Cask
link 'HockeyApp.app'
binary 'HockeyApp.app/Contents/Resources/puck'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.hockeyapp.mac', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/houdahspot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Houdahspot < Cask

link 'HoudahSpot.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.houdah.HoudahSpot', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/intellij-idea-ce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class IntellijIdeaCe < Cask

link 'IntelliJ IDEA 13 CE.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/IntelliJ IDEA 13 CE.app/Contents/Info.plist"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/intellij-idea.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class IntellijIdea < Cask

link 'IntelliJ IDEA 13.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/IntelliJ IDEA 13.app/Contents/Info.plist"
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/jabber-video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class JabberVideo < Cask

link 'Jabber Video.app'

after_install do
postflight do
system "/bin/rm", "#{destination_path}/Jabber Video.app/Contents/Resources/ForcedConfig.plist"
end
end
2 changes: 1 addition & 1 deletion Casks/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Java < Cask
homepage 'http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html'

install 'JDK 8 Update 20.pkg'
after_install do
postflight do
system '/usr/bin/sudo', '-E', '--',
'/usr/libexec/PlistBuddy', '-c', 'Add :JavaVM:JVMCapabilities: string BundledApp', "/Library/Java/JavaVirtualMachines/jdk#{version}.jdk/Contents/Info.plist"
system '/usr/bin/sudo', '-E', '--',
Expand Down
2 changes: 1 addition & 1 deletion Casks/jxplorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Jxplorer < Cask
homepage 'http://jxplorer.org'

link 'jxplorer-3.3.1.app'
after_install do
postflight do
system '/bin/chmod', '--', 'a+x', "#{destination_path}/jxplorer-3.3.1.app/Contents/MacOS/jxplorer"
end
end
2 changes: 1 addition & 1 deletion Casks/kaleidoscope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Kaleidoscope < Cask
link 'Kaleidoscope.app'
binary 'Kaleidoscope.app/Contents/Resources/bin/ksdiff'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.blackpixel.kaleidoscope', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/macupdate-desktop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MacupdateDesktop < Cask
appcast 'https://www.macupdate.com/desktop/updates.xml'

link 'MacUpdate Desktop.app'
after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.macupdate.desktop6', 'moveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/mamp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Mamp < Cask
homepage 'http://www.mamp.info/en/index.html'

install 'MAMP_MAMP_PRO_3.0.6.pkg'
after_install do
postflight do
system '/usr/bin/sudo', '-E', '--',
'/usr/sbin/chown', '-R', '--', "#{Etc.getpwuid(Process.euid).name}:staff", '/Applications/MAMP', '/Applications/MAMP PRO'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/nodeclipse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Nodeclipse < Cask
url 'https://downloads.sourceforge.net/sourceforge/nodeclipse/Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64.zip'
homepage 'http://www.nodeclipse.org/'

before_install do
preflight do
system '/bin/mv', '--', destination_path.join('eclipse/Eclipse.app'), destination_path.join('eclipse/Nodeclipse.app')
end
link 'eclipse/Nodeclipse.app'
Expand Down
2 changes: 1 addition & 1 deletion Casks/openarena.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Openarena < Cask

link 'openarena-0.8.8/OpenArena.app'

after_install do
postflight do
system '/bin/chmod', '--', '755', "#{destination_path}/openarena-0.8.8/OpenArena.app/Contents/MacOS/openarena.ub"
end
end
2 changes: 1 addition & 1 deletion Casks/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Parse < Cask
binary 'parse'
container_type :naked

after_install do
postflight do
system "chmod", "755", "#{destination_path}/#{title}"
end
end
2 changes: 1 addition & 1 deletion Casks/path-finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PathFinder < Cask

link 'Path Finder.app'

after_install do
postflight do
# Don't ask to move the app bundle to /Applications
system '/usr/bin/defaults', 'write', 'com.cocoatech.PathFinder', 'kNTMoveToApplicationsFolderAlertSuppress', '-bool', 'true'
end
Expand Down
2 changes: 1 addition & 1 deletion Casks/pd-extended.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PdExtended < Cask

link 'Pd-extended.app'

before_uninstall do
uninstall_preflight do
system '/bin/chmod', '-R', '--', 'u+w', "#{destination_path}/Pd-extended.app"
end
end
2 changes: 1 addition & 1 deletion Casks/phpstorm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Phpstorm < Cask

link 'PhpStorm.app'

after_install do
postflight do
system "/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", "#{destination_path}/PhpStorm.app/Contents/Info.plist"
end
end
Loading

0 comments on commit 4594b47

Please sign in to comment.