Skip to content

Commit

Permalink
simplify quoting of long shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Spiers committed Sep 2, 2013
1 parent 4b09dec commit ee092db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/capistrano-unicorn/capistrano_integration.rb
Expand Up @@ -111,14 +111,14 @@ def start_unicorn
primary_config_path = "#{unicorn_config_path}/#{unicorn_config_filename}"
secondary_config_path = "#{unicorn_config_path}/unicorn/#{unicorn_env}.rb"

script = <<-END
%Q%
if [ -e #{primary_config_path} ]; then
UNICORN_CONFIG_PATH=#{primary_config_path};
else
if [ -e #{secondary_config_path} ]; then
UNICORN_CONFIG_PATH=#{secondary_config_path};
else
echo "Config file for \"#{unicorn_env}\" environment was not found at either \"#{primary_config_path}\" or \"#{secondary_config_path}\"";
echo "Config file for "#{unicorn_env}" environment was not found at either "#{primary_config_path}" or "#{secondary_config_path}"";
exit 1;
fi;
fi;
Expand All @@ -134,9 +134,7 @@ def start_unicorn
echo "Starting Unicorn...";
cd #{app_path} && #{try_unicorn_user} RAILS_ENV=#{rails_env} BUNDLE_GEMFILE=#{bundle_gemfile} #{unicorn_bundle} exec #{unicorn_bin} -c $UNICORN_CONFIG_PATH -E #{unicorn_rack_env} -D #{unicorn_options};
END

script
%
end

def duplicate_unicorn
Expand Down

0 comments on commit ee092db

Please sign in to comment.