<?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>Label</key>
    <string>com.accountpilot.{{ plugin }}.daemon</string>

    <key>ProgramArguments</key>
    <array>
        <string>{{ accountpilot_bin }}</string>
        <string>{{ plugin }}</string>
        <string>daemon</string>
    </array>

    <key>RunAtLoad</key>
    <true/>

    <key>KeepAlive</key>
    <true/>

    <key>StandardOutPath</key>
    <string>{{ log_dir }}/{{ plugin }}.daemon.stdout.log</string>
    <key>StandardErrorPath</key>
    <string>{{ log_dir }}/{{ plugin }}.daemon.stderr.log</string>

    <key>WorkingDirectory</key>
    <string>{{ data_dir }}</string>

    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>{{ env_path }}</string>
{%- for k, v in extra_env.items() %}
        <key>{{ k }}</key>
        <string>{{ v }}</string>
{%- endfor %}
    </dict>
</dict>
</plist>
