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

Command line --version/-v flag #66

Closed
michaek opened this issue Sep 10, 2014 · 10 comments · Fixed by sass/libsass#693
Closed

Command line --version/-v flag #66

michaek opened this issue Sep 10, 2014 · 10 comments · Fixed by sass/libsass#693

Comments

@michaek
Copy link

michaek commented Sep 10, 2014

Currently, sassc does not have the ability to output sassc/libsass versions. This should probably mimic the functionality of the ruby executable.

@xzyfer
Copy link
Contributor

xzyfer commented Oct 21, 2014

Since there is now a rough roadmap and there is decent traction I think this is sensible.

Avoiding these kinds of thread would be great! sass/libsass#492 (comment)

@michaek
Copy link
Author

michaek commented Oct 22, 2014

Yep, that's exactly what I was thinking. Each libsass consumer should presumably be outputting the version of libsass it's using, in addition to its own version.

@xzyfer
Copy link
Contributor

xzyfer commented Dec 4, 2014

@mgreter @am11 I'm hearing a lot of demand for this. Ideally I'd like to get this into the upcoming Libsass 3.0.2 since there's already significant changes to the C api on master. Can we progress this?

/cc @jedfoster @sindresorhus

@mgreter
Copy link
Contributor

mgreter commented Dec 4, 2014

I think that would be a good thing, but IMO it should be automatically be taken from the git tags!

I personally often include this line in a Makefile:

GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)

Later I pass it to gcc to define the VERSION macro:

g++ -DVERSION="\"$(GIT_VERSION)\"" -Wall -c foobar.cpp

I also add a test if VERSION was not specified in the header:

#ifndef VERSION
#define VERSION "[NA]"
#endif

But not sure if this is really a good solution, since it involves calling git (check for .git?).

By the way, do you mean the version of sassc or libsass (or both)?

@xzyfer
Copy link
Contributor

xzyfer commented Dec 4, 2014

This only needs to be done at release time though right?

My main query is whether this needs to be in sassc or the libsass c api to be useful to upstream consumers like node-sass etc..

@am11
Copy link
Contributor

am11 commented Dec 4, 2014

/copy sass/node-sass#548 (comment).

Actually, if we need to serve it to node-sass from downstream, it should come from libsass (as we do not have dependency on sassc there).

@am11
Copy link
Contributor

am11 commented Dec 4, 2014

@mgreter, welcome back! 😄

@xzyfer
Copy link
Contributor

xzyfer commented Dec 4, 2014

My opinions on this can be summarised as

It's my opinion that users being able to access the version of Libsass is critical
Frankly I'm happy to hard code a string into the source if it gets the job done for now :)

@jedfoster
Copy link

I run sassmeister.com as a tool for the Sass community. I try to keep the various compilers up to date, including exposing compiler versions in the UI of the app. This is currently a manual process for the LibSass compiler, as there is no way to determine the version programmatically. I've already opened an issue on the node-sass project, sass/node-sass#548, but as @xzyfer pointed out, programmatic access to the version would have benefits beyond my simple application.

Keep up the great work!

@am11
Copy link
Contributor

am11 commented Dec 8, 2014

Bundle of thanks to @mgreter! 😄 👍
This is a tricky way to do it, the one I didn't thought of.

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

Successfully merging a pull request may close this issue.

5 participants