docker-machine: add launchd script

Closes #1893.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
acareccia 2016-06-11 12:55:13 +02:00 committed by Dominyk Tiller
parent 3a7b5a9068
commit d2b90e146e

View file

@ -36,6 +36,35 @@ class DockerMachine < Formula
end
end
plist_options :manual => "docker-machine start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin</string>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/docker-machine</string>
<string>start</string>
<string>default</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
assert_match /#{version}/, shell_output(bin/"docker-machine --version")
end