morganestes/sublime-recess

ST3: /bin/sh: recess: command not found

Closed this issue · 7 comments

/bin/sh: recess: command not found
[Finished in 0.4s with exit code 127]
[cmd: ['recess /Users/jasper/repo/test/css/modal.css --noIDs false --stripColors true']]
[dir: /Users/jasper/repo/test/css]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

Recess works fine on its own in the terminal.

Since Sublime Text doesn't load with the full $PATH set and available to Build Systems, you need to tell the plugin where your path to the recess executable is.

See https://github.com/morganestes/sublime-recess/wiki/Known-Issues for details.

After I made the changes according to the wiki you posted it did succesfully 'Check for errors' and displayed the result in the console.

However compiling the CSS file didn't work through Sublime Text. It creates a *-temp.css file (with the exact same content as the original CSS file) and empties the original *.css file leaving it blank. It then shows the following in the console:

/bin/sh: recess: command not found
[Finished in 0.0s with exit code 127]
[cmd: ['cp /Users/jasper/Development/www/cotonti/playground/themes/skeletonti/css/skeletonti.css skeletonti.temp.css && recess extras.temp.css --compile --noIds false --stripColors true > skeletonti.css && rm skeletonti.temp.css']]
[dir: /Users/jasper/Development/www/cotonti/playground/themes/skeletonti/css]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

which recess gives me: /usr/local/bin/recess so I have Recess.sublime-build set to:

  "osx": {
    "path": "/usr/local/bin:$PATH"
  },

It looks like you're trying to compile CSS to CSS, but Recess is designed to compile LESS to CSS.

It's a great linter for CSS, but if you want to use the compile option it's expecting that you're using the LESS syntax and outputting a CSS file.

See http://twitter.github.io/recess/ for how it works.

Ah okay.

recess default.css --compile > testing.css works fine in the terminal though and outputs a beautified CSS file.

Hrrmm. Yup, I just tried it on a wonky CSS file and it beautified it just
fine. Definitely weird that the linter would be okay with the path, but the
compiler isn't.

What should happen is during the build phase for the RecessCompile job is
this:

  1. Copy the original file to a temp.css in the same directory as the
    original,
  2. run recess on the temp file and replace the contents of the original
    file with the clean version,
  3. then remove the temp.css file

In the output you reported earlier, it looks like the first copy worked,
but then recess is trying to run on a different file named
extras.temp.css. I have no idea how that can happen.

So it looks like two problems to tackle:

  1. Why is recess not recognized in the path of the compile build job but
    it is in the lint job?
  2. Why is recess trying to run on a different file than the one that was
    just created?
  3. Bonus: why does it work for me but not for you?

Can you tell me what versions of node, recess, and OS X you're running?

Morgan W. Estes
about.me/morganestes

On Tue, Jan 7, 2014 at 10:08 AM, Jasper notifications@github.com wrote:

Ah okay.

recess default.css --compile > testing.css works fine in the terminal
though and outputs a beautified CSS file.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-31750675
.

Okay, I just had another look at the files and realised that the path in RecessCompile.sublime-build was not correct.
I corrected that and it seems to be all good now.

Glad to hear it's working.

I'm working on an update that will make it so that you only have to set it once. Thanks for the testing.