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

Setting the 'compileDir' #30

Closed
arjansingh opened this issue Mar 10, 2013 · 8 comments
Closed

Setting the 'compileDir' #30

arjansingh opened this issue Mar 10, 2013 · 8 comments

Comments

@arjansingh
Copy link
Contributor

Okay, so I've organized my project as follows:

/projectroot/coffee
/projectroot/js

I want the coffee-script in 'coffee' to compile into 'js'. I set my compileDir to '../js/' since that should be the relative path from my coffee-script directory. However, whenever I try to compile, it doesn't save to 'js'. If I just set compileDir to 'true' it'll compile in 'coffee' just fine.

I hope I'm being stupid and just forgetting something. Any thoughts?

@aponxi
Copy link
Collaborator

aponxi commented Mar 10, 2013

Thank you for reporting this!

I think you are doing everything right. From a quick glance at the code I see that here it should print the folder you specified in the console.

To help me find the problem you might first want to copy paste the console messages, see if it says something like "Compile dir specified: ../js". Then you might want to uncomment (if that's even a real word) the debug messages found in between these lines. Basically let it print those things I put there for debug purposes.

From that you should be able to see on the console:

  1. the output folder you specified
  2. If the output folder exists
  3. (this one is already not commented) the output folder you specified again, like this print "Compile dir specified: " + compile_dir
  4. if the output folder doesn't exist, in your case if js folder doesn't exist, it will create that; if it does then you should see print "Compile dir did not exist, created folder: " + compile_dir in console. (Again this is already not commented)
  5. The absolute path to the folder, in your case it should be something like /projectroot/js via this debug line print folder (This is also available by default, you don't have to uncomment that)
  6. arguments that is being supplied to the coffee compiler. In example something like coffee -b --output /projectroot/js
  7. Final arguments that will be passed to the coffee compiler, should be the same as the one above IF the compile directory is specified.

Those are the console outputs you should get after removing the # in front of the lines that are in this area.

Basically just copy paste some console outputs for me so that I can see where the problem lies! If you need any help gathering these information feel free to ask and I'll write a more visual and detailed response!

@arjansingh
Copy link
Contributor Author

Okay, after uncommenting and adding a quick print to also print the status out, here's what I get:

Writing file /Users/asingh/Projects/d3maps/coffee/canvas.coffee with encoding UTF-8
Compiling on save...
/Users/asingh/Projects/d3maps/coffee/canvas.coffee
../js
Compile dir specified: ../js
/Users/asingh/Projects/d3maps/coffee
['--output', u'../js', '-b', '-c', u'/Users/asingh/Projects/d3maps/coffee/canvas.coffee']
['--output', u'../js', '-b', '-c', u'/Users/asingh/Projects/d3maps/coffee/canvas.coffee']
Compilation Succeeded

Again, there's still no output to ../js.

However, if run coffee --output ../js -b -c /Users/asingh/Projects/d3maps/coffee/canvas.coffee, I do get output.

For reference, if is set compileDir to false I get:

Writing file /Users/asingh/Projects/d3maps/coffee/canvas.coffee with encoding UTF-8
Compiling on save...
/Users/asingh/Projects/d3maps/coffee/canvas.coffee
False
['-b', '-c', u'/Users/asingh/Projects/d3maps/coffee/canvas.coffee']
Compilation Succeeded

In this case, I get javascript output in the same directory as my coffee files, which is expected. Let me know if you need me to help out anymore. I'd debug myself a little more, but I'm not that familiar with python.

@aponxi
Copy link
Collaborator

aponxi commented Mar 11, 2013

You aren't on Windows are you?

@arjansingh
Copy link
Contributor Author

Nah. I'm on a Mac. Mountain Lion.


Arjan

Typos by iPhone.

On Mar 10, 2013, at 8:59 PM, Logan Howlett notifications@github.com wrote:

You aren't on Windows are you?


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

@aponxi
Copy link
Collaborator

aponxi commented Mar 11, 2013

I'll run tests on linux, and check for compatibility... Thanks for the updates :)

@arjansingh
Copy link
Contributor Author

Hey I was digging around. It seems like everything is compiling into /Sublime Text 2/Packages/.

It appears that if you specify a compileDir, /Sublime Text 2/Packages/sublime-better-coffeescript is your default path. Thus, when I used ../js it was creating js a level below /sublime-better-coffeescript/.

If I can get a change working I'll submit a pull request, but I'd thought I'd give you the heads up in case you can solve it faster.

aponxi pushed a commit that referenced this issue Mar 16, 2013
Modified code to check for relative or absolute path for "compileDir".
aponxi pushed a commit that referenced this issue Mar 16, 2013
@aponxi
Copy link
Collaborator

aponxi commented Mar 16, 2013

Ok... I haven't tested it yet, and merged the pull request. I hope it works! 😃

@arjansingh
Copy link
Contributor Author

😃 I tested it out on Mac. The filesystem will throw an error if you don't have permissions to create, but I think that's desired behavior.

@aponxi aponxi closed this as completed May 26, 2013
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