olmokramer / atom-stylus-autocompile

Compile .styl files on save in Atom
MIT License
5 stars 4 forks source link

The package read the second line #4

Closed pasqLisena closed 8 years ago

pasqLisena commented 8 years ago

If I start a .styl with more lines of comment, in my case:

// main: component-base.styl

// Media queries breakpoints (from https://gist.github.com/shengt/9259810)
.... stylus code following

the autocompile package continue to read the file name on the second line, so component-base.styl\Mediaqueriesbreakpoints(fromhttps (that does not exists).

It not happens when:


Atom Version: 1.0.19 System: Windows 7 Thrown From: stylus-autocompile package, v0.2.3

Stack Trace

Uncaught Error: ENOENT: no such file or directory, open '\stylus\component-base.styl\Mediaqueriesbreakpoints(fromhttps'

At fs.js:97

Error: ENOENT: no such file or directory, open '<myProjectPath>\stylus\component-base.styl\Mediaqueriesbreakpoints(fromhttps'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:137:20)
    at Object.fs.readFileSync (fs.js:397:15)
    at Object.fs.readFileSync (ATOM_SHELL_ASAR.js:384:29)
    at compile (C:/Users/f3805/.atom/packages/stylus-autocompile/lib/stylus-autocompile.js:37:17)
    at handleSave (C:/Users/f3805/.atom/packages/stylus-autocompile/lib/stylus-autocompile.js:25:5)
    at atom-text-editor.<anonymous> (C:/Users/f3805/.atom/packages/stylus-autocompile/lib/stylus-autocompile.js:12:65)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\f3805\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
    at C:\Users\f3805\AppData\Local\atom\app-1.0.19\resources\app.asar\src\command-registry.js:3:61

Commands

     -0:47.8.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:46 core:save (atom-text-editor.editor.is-focused)
  2x -0:38.6.0 core:undo (atom-text-editor.editor.is-focused)
     -0:36.1.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:35.8.0 core:save (atom-text-editor.editor.is-focused)
  2x -0:31.8.0 core:undo (atom-text-editor.editor.is-focused)
     -0:28.3.0 core:save (atom-text-editor.editor.is-focused)
  4x -0:24.6.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:23.7.0 core:save (atom-text-editor.editor.is-focused)
     -0:19.9.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -0:18.7.0 core:save (atom-text-editor.editor.is-focused)
  2x -0:06.3.0 core:delete (atom-text-editor.editor.is-focused)
  2x -0:05.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:04.4.0 core:save (atom-text-editor.editor.is-focused)
  3x -0:03.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:02.3.0 editor:delete-line (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "autocomplete-plus",
      "autocomplete-snippets",
      "svn",
      "webbox-color"
    ]
  }
}

Installed Packages

# User
angularjs, v0.3.0
autoclose-html, v0.19.0
color-picker, v2.0.13
compare-files, v0.6.2
eclipse-keybindings, v0.8.0
file-icon-supplement, v0.8.3
jshint, v1.8.0
linter, v1.8.1
linter-csslint, v1.0.7
pigments, v0.15.0
project-manager, v2.6.1
save-commands, v0.6.2
Stylus, v1.2.1
stylus-autocompile, v0.2.3

# Dev
No dev packages
olmokramer commented 8 years ago

Thanks for the report. I've just published a new version where I improved the parameter parsing. Please let me know if it works!

pasqLisena commented 8 years ago

Actually no :sob:

The problem is still here!

Nevertheless, thank you for your work

olmokramer commented 8 years ago

Do you have a out specified in component-base.styl?

pasqLisena commented 8 years ago

Yes, the problem is that it searches for component-base.styl\Mediaqueriesbreakpoints(fromhttps (that does not exists).

So that

// main: component-base.styl

does not work. Instead

// main: component-base.styl,

works becouse it search for the right file.

olmokramer commented 8 years ago

Ok, thanks. I'll try something else then. Back in a few minutes :)

olmokramer commented 8 years ago

I just pushed some commits to the master branch that should theoretically fix this issue. Can you please uninstall the package and clone this repository into .atom/packages to test if it works?

olmokramer commented 8 years ago

I published it anyway, because there seemd to be a crash that prevented saving in v0.3.0

pasqLisena commented 8 years ago

It works :fireworks: !!!

Thank you very much :smiley:

olmokramer commented 8 years ago

Yay! You're welcome :-)