Skip to content

Commit

Permalink
Instead of only restarting/redirecting to powsered app, allow users t…
Browse files Browse the repository at this point in the history
…o now goto http://powser.dev/restart?app=myapp.  Powsered app is now
  • Loading branch information
Ricky Chilcott committed Nov 27, 2011
1 parent ef3bf80 commit 8271472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/powser
Expand Up @@ -23,7 +23,7 @@ module Powser
File.open("app", "w") do |f|
f.puts(app)
end
say "Powser is now active for #{app}."
say "Powser defaults to #{app}."
end
end

Expand All @@ -32,7 +32,7 @@ module Powser
app ||= get_pow_name
Dir.chdir(SERVER_PATH) do
`powder unlink`
say "Powser is no longer active for #{app}."
say "Powser no longer defaults to #{app}."
end
end

Expand Down
4 changes: 4 additions & 0 deletions lib/powser/server.rb
Expand Up @@ -10,6 +10,8 @@ class Server < Sinatra::Base

# Routes ------------------------------------------------------------------
get '/restart' do
@pow_app = params[:app] if params[:app]

to_url = redirect_url(params[:redirect])
pow_dir(@pow_app) do
`powder restart`
Expand All @@ -18,6 +20,8 @@ class Server < Sinatra::Base
redirect to_url
end

private

# Helpers -------------------------------------------------------------------
def pow_dir(app_name, &block)
path = POW_PATH + '/' + app_name
Expand Down

0 comments on commit 8271472

Please sign in to comment.