Giter Club home page Giter Club logo

Comments (23)

badsyntax avatar badsyntax commented on July 24, 2024

Please let me know what version of sass and sass-convert you're using.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Can you also run this from the cli and let me know the output?

sass-convert --indent 4  --to scss --stdin <<< ".test{color:red}"

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024

Sure, I am using sass version 3.2.10.

The output for test is:

.test {
    color: red;
}

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

That doesn't make sense to me. This plugin is simply a wrapper around sass-convert. If you can run sass-convert from the CLI you should be able to run it from this plugin.

  • What OS version are you on?
  • Have you tried uninstalling and re-installing?
  • Can you let me know what plugin version you're using? (Package Controll >> List packages)
  • Do you have custom plugin settings? If so paste them here..

Thanks.

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024
  1. What OS version are you on?
    • OSX Mountain Lion 10.8.4
  2. Have you tried uninstalling and re-installing?
    • Yes
  3. Can you let me know what plugin version you're using? (Package Controll >> List packages)
    • 2013.08.12.20.57.29
  4. Do you have custom plugin settings? If so paste them here.
    • I do not have any custom plugin settings. My User/SassBeautify.sublime-settings file is empty

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

I'm almost out of ideas on this one. Do you get this error for every file you try to beautify?

Can you please try the following:

Before beautifying, can you open up the Sublime Text console: View >> Show Console
Then try beautifying, then copy and paste the debug text here.

Thanks.

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024

(1) Do you get this error for every file you try to beautify?

Yes, and I have tried both scss and sass files.

(2) Console Log:

error: There was an error beautifying your Sass:
OptionParser::InvalidOption: invalid option: --indent
Use --trace for backtrace.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Ok, we're going to have to break it down.

Can you paste this into the console in sublime text and let me know the output?

import os;import subprocess;process=subprocess.Popen(['sass-convert','--unix-newlines','--stdin','--indent', '4','--to', 'scss'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate(input=".test{color:red}".encode('utf-8'));output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024

The console output from your string was:
OptionParser::InvalidOption: invalid option: --indent
Use --trace for backtrace.

If I remove --indent 4 from your string I receive this out put:

.test {
  color: red; }

This got me thinking and so I tried to run sass-convert --indent file.scss --to scss from the terminal and I received the same error. I then ran sass-convert --indent 4 file.scss --to scss and I had success, the console gave me to correct output with formatting. Could there be an issue with sass-convert not recognizing the indentation parameter?

I hope this helps. Thank you for taking the time to look into this.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Man this is really weird, I just can't replicate what you're seeing. It's quite frustrating. Thanks for holding out with me.

At this stage, we only know this much:

  1. sass-convert works as expected from the terminal
  2. sass-convert does not work as expected when run from Sublime Text.
  3. The output that you get, when running sass-convert without --indent from sublime text, is not the default output for sass-convert. (The closing brace should be on a new line.)

The above points suggest a different version of sass-convert is being used when run from sublime text.

  • In terminal, can you let me know the output of which sass-convert
  • In sublime text console, can you let me know the output of import os;print(os.environ.copy())
  • In sublime text console, can you let me know the output of the following:
    import os;import subprocess;process=subprocess.Popen(['which','sass-convert'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate();output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024
  1. In terminal, can you let me know the output of which sass-convert
    • Sass 3.2.10 (Media Mark)
  2. In sublime text console, can you let me know the output of import os;print(os.environ.copy())
    • os;print(os.environ.copy())
      <module 'os' from '/Applications/Sublime Text.app/Contents/MacOS/python3.3.zip/os.pyo'>
      {'LOGNAME': 'me', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'SSH_AUTH_SOCK': '/tmp/launch-sTpFGW/Listeners', 'HOME': '/Users/me', 'SHELL': '/bin/bash', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'TMPDIR': '/var/folders/m6/fzblr91575v9yv1_zvcb4v3r0000gn/T/', 'Apple_PubSub_Socket_Render': '/tmp/launch-scoBeX/Render', 'USER': 'me', 'Apple_Ubiquity_Message': '/tmp/launch-Icux4R/Apple_Ubiquity_Message', 'COMMAND_MODE': 'unix2003'}

  3. In sublime text console, can you let me know the output of the following: import os;import...
    • import os;import subprocess;process=subprocess.Popen(['which','sass-convert'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate();output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);
      /usr/bin/sass-convert

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

When typing which sass-convert in terminal, i would expect a path, like " /usr/bin/sass-convert". Can you try that again?

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024

Sure, it looks as though terminal is referencing the gem location.
/Users/me/.rvm/gems/ruby-1.9.3-p125/bin/sass-convert

from sassbeautify.

edwardsdesign avatar edwardsdesign commented on July 24, 2024

I checked my /usr/bin/ and the version of sass was from last 2012. I reinstalled sass (which sass-convert now points to /usr/bin/) and now SassBeautify is working like a charm. Not sure why it was referencing the gem location. Great support, thank you for helping me out with this.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Ahhh, RVM!! Yea RVM will change your PATH which is why a different sass version was being used in SassBeautify. This has caused issues for others as well, which is why I added a custom path option to this plugin.

If you want to continue to use RVM, you can try add the RVM sass bin folder path to the SassBeautify settings. (There's probably a more elegant solution, but I haven't figured it out yet as I'm not entirely familiar with RVM.)

I'm just glad we got there in the end! 👍

from sassbeautify.

Estlopacu avatar Estlopacu commented on July 24, 2024

Hello

I am having problems with this same error. I try to edit the file SassBeautify.sublime-settings with the new path /usr/bin/ and I didn't have lucky. I also reinstalled sass and also I am using RVM.

Any help please! I have big sass files....

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

@Estlopacu Type the following into terminal and let me know the output: which sass-convert

from sassbeautify.

Estlopacu avatar Estlopacu commented on July 24, 2024

This /Users/estebanlopez/.rvm/gems/ruby-1.9.3-p429/bin/sass-convert

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

If you add /Users/estebanlopez/.rvm/gems/ruby-1.9.3-p429/bin to the plugin path setting it should work. I'm going to try add a new feature to this plugin to add the RVM ruby path automatically. I'm tracking that with issue #18.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

@Estlopacu Actually adding that path will probably not work. I've reopened issue #1 and am working on a proper fix for this.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

I think we can finally put this one to bed: https://github.com/badsyntax/SassBeautify#compatibility-with-rvm

Upgrade to the latest version (which includes a PATH fix):

  • Open up the command pallete (cmd/ctrl + shift + p)
  • Select: "Package Control: Upgrade Package"
  • Select SassBeautify

from sassbeautify.

Estlopacu avatar Estlopacu commented on July 24, 2024

It works perfect! Thanks for you help.

Pura vida!! as we say in my country Costa Rica.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Very happy to hear, thank you :) RVM has caused me many headaches and I'm glad to finally figure out how it modifies the environment settings.

from sassbeautify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.