Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Compiling should create output directory #574

Closed
SebastianOsuna opened this issue Dec 17, 2014 · 10 comments
Closed

Compiling should create output directory #574

SebastianOsuna opened this issue Dec 17, 2014 · 10 comments

Comments

@SebastianOsuna
Copy link
Contributor

Hello guys,

I was using the library to build compile a scss file. I noticed the library doesn't use something like mkdir or mkdirp to create the output directory in case it doesn't exists.

Here is the command I used:
node-sass --output-style compressed src/css/my_project.scss lib/css/my_project.min.css

Thanks

@keithamus
Copy link
Member

Great idea @SebastianOsuna, thanks for filing! If you'd like you could make a PR and end up on our hall of fame

@SebastianOsuna
Copy link
Contributor Author

Will do. Give me a couple days to work on it ;)

@SebastianOsuna
Copy link
Contributor Author

@keithamus just forked but tests fail with 'Segmentation fault (core dumped)' in the '.render(importer)#should override imports with "file" as input and fires callback with file and contents' test.

What I did:

  1. git clone ...
  2. npm install
  3. git submodule init
  4. git submodule update
  5. npm test

Am I doing something wrong?

@browniefed
Copy link

@SebastianOsuna seems like not your fault, issue #586 is tracking that issue.

@keithamus
Copy link
Member

Looks like you're doing everything right @SebastianOsuna. I think @browniefed may be right; but @am11 may have some good insight into this.

@am11
Copy link
Contributor

am11 commented Dec 30, 2014

@SebastianOsuna, that specific test is passing on my master branch in Linux and Windows (but this is not definite that they will always pass, libuv is looking weirder by the second). But then there is another set of tests consistently failing on Linux (render({stats} et al.), which is some tricky memory leak.

Having said that, you can just ignore all that and implement your feature and test it by deleting test/api.js file and overwriting all tests in cli.js with your tests. Once your tests pass, copy them into buffer, git checkout test/api.js and git checkout test/cli.js and add update cli.js with your tests before committing.

Not the elegant way, but considering that we are going through this rough patch, fighting the memory leaks and affirming compatibility with libsass API v2, that is a timely workaround. node-sass will definitely improve over time.

@SebastianOsuna
Copy link
Contributor Author

@am11 Thanks for the details.

I got the tests to run on my Windows machine. There is one test failing though. 'cli -> node-sass -> in.css -> should render all watched files'.

I expect to have the pull request for this issues soon :)

@am11
Copy link
Contributor

am11 commented Feb 12, 2015

npm install node-sass@2.0.0 is released!
Checkout the release notes: https://github.com/sass/node-sass/releases/tag/v2.0.0

@am11 am11 closed this as completed Feb 12, 2015
@nozpheratu
Copy link

Does this only apply to the CLI? Doesn't appear to work when I call the render function from JavaScript.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 17, 2016

@nozpheratu as is made clear in the documentation, the render functions return the result of the compilation as a Buffer. It's you're responsibility to write it to disk if that's what you want.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

6 participants