Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a non-zero exit code when Pow cannot be reached by powder status #125

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/powder
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ module Powder
POW_DAEMON_PLIST_PATH="#{ENV['HOME']}/Library/LaunchAgents/cx.pow.powd.plist"
POW_FIREWALL_PLIST_PATH = "/Library/LaunchDaemons/cx.pow.firewall.plist"

def self.exit_on_failure?
true
end

desc "env", "Pass an arbitrary environment variable to pow"
def env(key = nil, value = nil)
if key.nil?
Expand Down Expand Up @@ -333,7 +337,7 @@ module Powder
def status
http_port = ":" + configured_pow_http_port.to_s
results = %x{curl --silent -H host:pow 127.0.0.1#{http_port}/status.json}.gsub(':','=>')
return say("Error: Cannot get Pow status. Pow may be down. Try 'powder up' first.") if results.empty? || !(results =~ /^\{/)
raise(Thor::Error, "Error: Cannot get Pow status. Pow may be down. Try 'powder up' first.") if results.empty? || !(results =~ /^\{/)
json = eval results
json.each {|k,v| say "#{k.ljust(12, ' ')} #{v}"}
end
Expand Down