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

When exporting snippets there is always an non neccesary trailing space #873

Closed
oscarsan opened this issue Feb 13, 2019 · 3 comments
Closed

Comments

@oscarsan
Copy link
Contributor

Expected behavior

The space is not really necessary there, and it's adding one each time you export/import, which can be many times in development

Actual behavior

Trailing space should not be added

Steps to reproduce

Create a snippet, export and import it

problem is in seeds.rb on line 96, not sure what those \n are doing there.
https://github.com/comfy/comfortable-mexican-sofa/blob/master/lib/comfortable_mexican_sofa/seeds.rb#L98

    def write_file_content(path, data)
      ::File.open(::File.join(path), "wb") do |f|
        data.each do |item|
          f.write("[#{item[:header]}]\n")
          f.write("#{item[:content]}\n")
       end
     end
  end

System configuration

Rails version: 5.2.1

CMS version: 2.0.17

Ruby version: 2.5.1

@GBH
Copy link
Member

GBH commented Feb 13, 2019

I don't actually remember why it's there. Try removing and see if export/import still works correctly. if it does, feel free to submit PR. Thanks!

@oscarsan
Copy link
Contributor Author

Well, i fixed this actual striping content, but I will try, because in an environment where you need to constantly import export (maybe this is just me, i'm using highly to move stuff from development to production and vice versa) the content is getting bigger and bigger all the time.

@lopesrb
Copy link
Contributor

lopesrb commented Mar 30, 2020

@oscarsan were you able to solve this?

@GBH GBH closed this as completed Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants