Sha256: 9d13f657589f8a56e3524d7ac1196e0c51d9f17fa63633262ae035dbc51d9629

Contents?: true

Size: 645 Bytes

Versions: 3

Compression:

Stored size: 645 Bytes

Contents

#
# Cookbook Name:: mongodb
# Recipe:: plist
#

Chef::Log.info("Configuring mongodb to automatically start on login")

destination_plist = "#{ENV['HOME']}/Library/LaunchAgents/org.mongodb.mongod.plist"
plist_path = "$(brew --prefix mongodb)/org.mongodb.mongod.plist"

execute "unloading existing plist" do
  command "launchctl unload -w -F #{destination_plist}"
  only_if "test -f #{destination_plist}"
end

execute "adding plist to login" do
  command <<-EOS
    mkdir -p #{ENV['HOME']}/Library/LaunchAgents
    cp -f #{plist_path} #{destination_plist}
    chmod 0644 #{destination_plist}
    launchctl load -w -F #{destination_plist}
  EOS
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flombe-0.1.0.12 cookbooks/mongodb/recipes/plist.rb
flombe-0.1.0.11 cookbooks/mongodb/recipes/plist.rb
flombe-0.1.0.10 cookbooks/mongodb/recipes/plist.rb