Skip to content
New issue

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

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

Already on GitHub? # to your account

Queue echo command with long string causes output error #299

Closed
nwshane opened this issue Apr 6, 2015 · 2 comments
Closed

Queue echo command with long string causes output error #299

nwshane opened this issue Apr 6, 2015 · 2 comments
Labels

Comments

@nwshane
Copy link

nwshane commented Apr 6, 2015

I added a queue echo command to the mina setup task that outputs a long string, one that has to wrap around a couple of time to be displayed in the terminal. (The reason for this is that the string is a command, and I want users to be able to copy the command directly; otherwise I would have distributed the string over multiple echo commands.)

The problem is that, instead of just displaying the string once as expected, the terminal shows the first line of the string twice. In other words, if I'm running this command:

queue  %[echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]

Then the terminal will output something like:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nost
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The additional (unwanted) first line fills the width of the terminal, so its length depends on how wide the terminal is in the window. It's impossible to display the output in the exact same way here on github, so you have to imagine that in the above example the second line wraps after 'quis nost', i.e. where the first line ends.

@d4be4st d4be4st added the bug label Jul 5, 2015
@pramodshinde
Copy link

@nwshane @d4be4st

I just checked this issue with latest version 0.3.8, after adding above string in mina setup task it got printed correctly.

output-correct

Here in my deploy.rb

task :setup => :environment do
  queue  %[echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]
  queue! %[mkdir -p "#{deploy_to}/shared/log"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

  queue! %[mkdir -p "#{deploy_to}/shared/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

  queue! %[mkdir -p "#{deploy_to}/shared/tmp"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/tmp"]

  queue! %[touch "#{deploy_to}/shared/config/database.yml"]
  queue  %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
end

Am I doing it correctly? If yes this issue can be closed.

@d4be4st
Copy link
Member

d4be4st commented Jul 8, 2016

This should be fixed in new 1.0.0 release

@d4be4st d4be4st closed this as completed Jul 8, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants