Bachalo
Bachalo

Reputation: 7219

Coffeescript basic compiling error

Just getting started with Coffeescript and have installed it correctly , however having problems getting basic compilation to work

I have 2 folders names 'src' and 'js'

I create a simple .coffee file in the src folder called test.coffee

In the parent folder I open a terminal window and type the following

coffee -wc src -o js

This SHOULD automatically compile any .coffee files in the src folder and put in the js folder but I always get an error

File not found: –wc.coffee

What am I doing wrong?

Upvotes: 1

Views: 1094

Answers (2)

Linus Thiel
Linus Thiel

Reputation: 39261

Coffee is picky about parameter order.

Usage: coffee [options] path/to/script.coffee -- [args]

As you see, you have to specify all options before the script (or directory) you want to compile:

coffee -w -c -o js src

or

coffee -wco js src

Upvotes: 3

Mark Thomas
Mark Thomas

Reputation: 37527

According to the usage examples on coffeescript.org, the "watch" functionality is for files, not directories.

Try dropping the -w.

Upvotes: 0

Related Questions