Skip to content

Commit

Permalink
Fix #565
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Apr 29, 2015
1 parent 096564c commit 184f561
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions lib/symfony2/symfony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
puts " Latest assets version: (#{assets_version})"

file_path = "#{latest_release}/#{app_config_path}/assets_version.yml"
file_content = "parameters:\\n assets_version: #{assets_version}"
file_content = "parameters:\n assets_version: #{assets_version}"
run "echo '#{file_content}' | #{try_sudo} tee #{file_path}"
capifony_puts_ok
end
Expand Down Expand Up @@ -192,64 +192,64 @@
capifony_puts_ok
else
capifony_pretty_print "--> Installing Composer dependencies"

command = "#{try_sudo} sh -c 'cd #{latest_release} && SYMFONY_ENV=#{symfony_env_prod} #{composer_bin} install #{options}'"

if interactive_mode

input = ''
print_wizard = false
close_header = true
run(command, { :pty => true, :eof => false }) do |channel, stream, data|

# on normal output
channel.on_data do |ch, data|

# check if composer is waiting for user input
print_wizard = data =~ /:[[:space:]]*$/

# avoid echoing the user input
if input.strip != data.strip and not print_wizard
logger.debug data
end

# if input has been requested
if print_wizard

if close_header

# finalize the info string
capifony_puts_ok

# and open a new section
capifony_pretty_print "--> Updating parameters"
puts if logger.level == Logger::IMPORTANT

close_header = false
end

print data

# capture the user input
input = $stdin.gets

# send it to the remote process
channel.send_data(input)
end
end

# on error
channel.on_extended_data do |ch, data|
warn "[err :: #{ch[:server]}] #{data}"
end
end

capifony_pretty_print "--> Parameters updated" if not close_header

else
run command
end

capifony_puts_ok
end
end
Expand All @@ -267,64 +267,64 @@
end

capifony_pretty_print "--> Updating Composer dependencies"

command = "#{try_sudo} sh -c 'cd #{latest_release} && SYMFONY_ENV=#{symfony_env_prod} #{composer_bin} update #{options}'"

if interactive_mode

input = ''
print_wizard = false
close_header = true
run(command, { :pty => true, :eof => false }) do |channel, stream, data|

# on normal output
channel.on_data do |ch, data|

# check if composer is waiting for user input
print_wizard = data =~ /:[[:space:]]*$/

# avoid echoing the user input
if input.strip != data.strip and not print_wizard
logger.debug data
end

# if input has been requested
if print_wizard

if close_header

# finalize the info string
capifony_puts_ok

# and open a new section
capifony_pretty_print "--> Updating parameters"
puts if logger.level == Logger::IMPORTANT

close_header = false
end

print data

# capture the user input
input = $stdin.gets

# send it to the remote process
channel.send_data(input)
end
end

# on error
channel.on_extended_data do |ch, data|
warn "[err :: #{ch[:server]}] #{data}"
end
end

capifony_pretty_print "--> Parameters updated" if not close_header

else
run command
end

capifony_puts_ok
end

Expand Down

0 comments on commit 184f561

Please sign in to comment.