Class: RepoTender::CLI::Daemon::Restart
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- RepoTender::CLI::Daemon::Restart
- Includes:
- Helpers, GlobalOptions
- Defined in:
- lib/repo_tender/cli/daemon.rb
Instance Method Summary collapse
Methods included from GlobalOptions
Methods included from Helpers
build_plist, fail_with, format_failure, make_agent, plist_path
Instance Method Details
#call(plain: nil, json: nil, no_color: nil, quiet: nil) ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/repo_tender/cli/daemon.rb', line 234 def call(plain: nil, json: nil, no_color: nil, quiet: nil, **) mode = UI::Mode.resolve( flags: {plain: plain, json: json, no_color: no_color, quiet: quiet}, env: CLI.env, out: out ) pastel = Pastel.new(enabled: mode.color) label = Launchd::Agent::DEFAULT_LABEL agent = make_agent result = agent.restart if result.failure? return fail_with(self, "restart failed: #{format_failure(result.failure)}") end out.puts pastel.green("restarted: #{label}") CLI.record_outcome(Outcome.new(exit_code: 0)) end |