Skip to content

Commit

Permalink
fix install: create ~/Library/LaunchAgents if does not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot authored and defunkt committed Aug 17, 2011
1 parent ebdcb91 commit 92b55ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ namespace :install do
desc "Install launch agent"
task :agent do
plist = "com.github.dotjs.plist"
agent = File.expand_path("~/Library/LaunchAgents/#{plist}")

agent_dir = File.expand_path("~/Library/LaunchAgents/")
agent = File.join(agent_dir, plist)
Dir.mkdir(agent_dir) unless File.exists?(agent_dir)
File.open(agent, "w") do |f|
f.puts ERB.new(IO.read(plist)).result(binding)
end
Expand Down

0 comments on commit 92b55ff

Please sign in to comment.