This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flycut: oh ugly hack, how I abhor thee!
- Loading branch information
Brian Cunnie
committed
Oct 26, 2012
1 parent
f1d0c47
commit e40592d
Showing
1 changed file
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
# fixme: This should be re-factored once package.rb has a mechanism | ||
# FIXME: This should be re-factored once package.rb has a mechanism | ||
# for installing pkg files without mounting a dmg | ||
include_recipe "pivotal_workstation::addloginitem" | ||
|
||
app_path="/Applications/Flycut.app" | ||
|
||
ruby_block "Install Flycut" do | ||
block do | ||
system("cd #{Chef::Config[:file_cache_path]}/ && curl -OL https://github.com/downloads/TermiT/Flycut/flycut1.5.pkg") | ||
system("installer -allowUntrusted -package #{Chef::Config[:file_cache_path]}/flycut1.5.pkg -target /") | ||
system("chown -R #{WS_USER} #{app_path}") | ||
# oh ugly hack, how I abhor thee! | ||
system("su #{WS_USER} -c \"addloginitem #{app_path}\"") | ||
end | ||
not_if {File.exists?("/Applications/Flycut.app")} | ||
end | ||
|
||
# start up on login | ||
execute "Start Flycut automatically" do | ||
command "defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{ \"Path\" = \"/Applications/Flycut.app\"; \"Hide\" = 0; }'" | ||
user WS_USER | ||
not_if {File.exists?(app_path)} | ||
end | ||
|
||
ruby_block "test that Flycut install worked" do | ||
block do | ||
raise "Flycut install failed!" if ! File.exists?("/Applications/Flycut.app") | ||
raise "Flycut install failed!" if ! File.exists?(app_path) | ||
end | ||
end |