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

Set input/output directory #18

Closed
feugy opened this issue Jan 24, 2013 · 8 comments
Closed

Set input/output directory #18

feugy opened this issue Jan 24, 2013 · 8 comments

Comments

@feugy
Copy link

feugy commented Jan 24, 2013

It whould be very handy to allow users setting the --output and --compiler options of the coffee-script compiler.

Currently, the compiled js file is generated in the coffee file parent folder.
Having a src/ folder for coffee script and a lib/ folder for compiled js is a common project layout.

Thanks a lot !

@aponxi
Copy link
Collaborator

aponxi commented Jan 24, 2013

Hey, thanks for the idea. I usually just compile when i'm packaging the application so I don't know what kind of approach would be most practical with this. Do you think "rules" for compiling for specific files would be a good option or would it be overkill?

  1. In example you have a src/foo.coffee that you want to be compiled with --bar args but you want src/foo2.coffee to be compiled with --baz args.
  2. Or should there be a global compiling options that you can set which make coffees always compiled with --bar args and to baz dir.

I'm guessing the first one is more like a Cakefile thing so just having the option to specify compile dir and args would suffice?

Also could you give me a couple alternative examples on how you want it to work please? From what I understand just specifying relative dirs such as ../lib or ../../lib would suffice right?

I'm just brainstorming with you to plan extensiblity in the future. If all you want is something simple just let me know :)

@feugy
Copy link
Author

feugy commented Jan 25, 2013

I think you should begin with the second solution: ability to specify -o and -c options of the coffee-script compiler.

Relative path seems a good option (please take care of portability) because dealing with absolute path when you work in teams is a real pain.

I guess that people who wants more customization will write their own cake file, as you mention it in the documentation.

@aponxi
Copy link
Collaborator

aponxi commented Jan 26, 2013

Thank you for your response :)

I am now adding the arg options... But one thing isn't clear to me, when you say you want to specify -c option what exactly do you mean? From what I see it goes like coffee -c script.coffee. if you have the ability to specify -c option's argument then it would mean that you want to be able to compile a specific file when you hit alt+shift+c is that what you want?

Doing -o some/dir is easy though, I can add an option that says compileDir and if it is set to a directory it will add -o that/directory; if it is False or not string it will compile it into the same dir (as it is now).

@aponxi
Copy link
Collaborator

aponxi commented Jan 26, 2013

  • As far as right now I was only able to make relative path to the file that is being compiled. Trying to work on a way to get the project's folder.
  • Output dir option works only if directory is present, gonna write a function that makes dir.

@feugy
Copy link
Author

feugy commented Jan 26, 2013

Forget about the -c option: your plugin takes the saved file to compile it, which is the right thing to do.

As I used the other Sublime Text Coffee plugin, which do not compile coffee, I configured a custom build to compile all my coffee script after save (thank to SublimeOnSaveBuild). That's why I needed the -c, to specify a directory, and not a file.

But as you're only compiling the saved file, there is no need of it.

@aponxi aponxi closed this as completed in 3e826ef Jan 27, 2013
@aponxi
Copy link
Collaborator

aponxi commented Jan 27, 2013

@feugy please let me know if there are any problems :) it should be working

@feugy
Copy link
Author

feugy commented Jan 28, 2013

Works perfectly for me except one thing: the error reporting.
When one of the file does not compile (not necessarly the saved one), no error is reported on console.

@aponxi
Copy link
Collaborator

aponxi commented Jan 28, 2013

@feugy it should be saying Compilation Failed/Succeeded in the status bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants