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

Autorun mode #56

Merged
merged 3 commits into from
Dec 30, 2012
Merged

Autorun mode #56

merged 3 commits into from
Dec 30, 2012

Conversation

G3z
Copy link
Contributor

@G3z G3z commented Dec 29, 2012

you have now the ability to compile run and debug node.js applications using toaster.
i hope you like it :)

@ghost ghost assigned arboleya Dec 29, 2012
@arboleya
Copy link
Owner

Apparently all goes fine, thank you very much. :)

I'm just wondering, maybe it's cool to let some option like default args to be passed to the script?

What do you think of this?

toaster -a create some/path some/name

So if you log the process.argv in your release file, you should see:

console.log process.argv
# outputs
# [ 'create', 'some/path/', 'some/name' ]

Important to considerer that it may be called in more than one way:

toaster -a args.. # ok
toaster -ad args.. # not ok, the args will go to the `debug` option
toaster -da args.. # ok

Did you needed when using this autorun mode?

@G3z
Copy link
Contributor Author

G3z commented Dec 29, 2012

i needed this feature while i was building a webserver so i din't need args. what i needed, but don't have a clue on how to do, it is file splitting for debug. I love that toaster splits files in debug mode so it's easier to follow the code, but i don't know how to do it properly in node.js.
i'll look into arguments implementation BTW.

@G3z
Copy link
Contributor Author

G3z commented Dec 29, 2012

this

console.log process.argv

launched with

toaster -a bella

now outputs

[16:51:53] Compiled /Users/g3z/Desktop/test/bin/app.js
Application started:
[ '/Users/g3z/.nvm/v0.8.16/bin/node',
  '/Users/g3z/Desktop/test/bin/app.js',
  'bella' ]

the only difference with a manual execution

node bin/app.js bella

is that the node path is not expanded

[ 'node',
  '/Users/g3z/Desktop/test/bin/app.js',
  'bella' ]

-a and -da works as expected. I've updated the Readme with a note on -ad not behaving as expeted

@arboleya arboleya merged commit 8ffa9f7 into arboleya:master Dec 30, 2012
@arboleya
Copy link
Owner

Hi, thank you very much for contributing. :)
https://github.com/serpentem/coffee-toaster/commits/master
https://github.com/serpentem/coffee-toaster/blob/master/build/CHANGELOG.md#0611---12292012

About this:

I love that toaster splits files in debug mode so it's easier to follow the code, but i don't know how to do it properly in node.js.

Yes, there's no currently debug option for nodejs apps. Toaster do the individual compilation just for the browser by now.

But I assure you it's a TODO.

Will require a new nature property in the toaster.coffee which can be browser or node.

This should be enough plus the individual compilation.

The only point is that for this to work, the 'expose' property will have to be true, otherwise packages wont be available via require.

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 this pull request may close these issues.

2 participants