Permalink
Browse files

flycut: oh ugly hack, how I abhor thee!

  • Loading branch information...
1 parent f1d0c47 commit e40592da7ee46a8f8a13643e0fe733b1b6157af1 Brian Cunnie committed Oct 26, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −9 recipes/flycut.rb
View
@@ -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

0 comments on commit e40592d

Please sign in to comment.