lib/launch_agent/cli.rb in launch-agent-0.5.0 vs lib/launch_agent/cli.rb in launch-agent-0.6.0
- old
+ new
@@ -9,17 +9,17 @@
def agent
raise 'full command must be supplied' if @argv.empty?
daemon = @opts[:daemon]
interval = @opts[:interval]
- env = @opts[:env]
+ env = @opts[:env].split(',')
wdir = @opts[:wdir]
agent = nil
if daemon
agent = LaunchAgent::Daemon.new(*@argv)
- elsif @opts[:interval]
- agent = LaunchAgent::Periodic.new(interval, *@argv)
+ elsif interval
+ agent = LaunchAgent::Periodic.new(interval.to_i, *@argv)
else
raise 'at least one of --daemon and --interval must be set'
end
agent['EnvironmentVariables'] = env.inject({}) do |memo, e|