mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
fixing paths for running
coffee compiles CoffeeScript source files into JavaScript.
Usage:
coffee path/to/script.coffee
-i, --interactive run a CoffeeScript REPL (requires Narwhal)
-r, --run compile and run a script (requires Narwhal)
-o, --output [DIR] set the directory for compiled JavaScript
-w, --watch watch scripts for changes, and recompile
-p, --print print the compiled JavaScript to stdout
-l, --lint pipe the compiled JavaScript through JSLint
-e, --eval compile a cli scriptlet or read from stdin
-t, --tokens print the tokens that the lexer produces
-v, --verbose print at every step of code generation
-n, --no-wrap raw output, no safety wrapper or vars
--install-bundle install the CoffeeScript TextMate bundle
--version display CoffeeScript version
-h, --help display this help message outside of the coffee-script directory
This commit is contained in:
@@ -19,6 +19,9 @@ Usage:
|
||||
# Seconds to pause between checks for changed source files.
|
||||
WATCH_INTERVAL = 0.5
|
||||
|
||||
# Path to the Narwhal Launcher:
|
||||
LAUNCHER = File.expand_path(File.dirname(__FILE__)) + '/narwhal/js/launcher.js'
|
||||
|
||||
# Run the CommandLine off the contents of ARGV.
|
||||
def initialize
|
||||
@mtimes = {}
|
||||
@@ -104,7 +107,7 @@ Usage:
|
||||
|
||||
# Use Narwhal to run an interactive CoffeeScript session.
|
||||
def launch_repl
|
||||
exec "narwhal lib/coffee_script/narwhal/js/launcher.js"
|
||||
exec "narwhal #{LAUNCHER}"
|
||||
rescue Errno::ENOENT
|
||||
puts "Error: Narwhal must be installed to use the interactive REPL."
|
||||
exit(1)
|
||||
@@ -113,7 +116,7 @@ Usage:
|
||||
# Use Narwhal to compile and execute CoffeeScripts.
|
||||
def run_scripts
|
||||
sources = @sources.join(' ')
|
||||
exec "narwhal lib/coffee_script/narwhal/js/launcher.js #{sources}"
|
||||
exec "narwhal #{LAUNCHER} #{sources}"
|
||||
rescue Errno::ENOENT
|
||||
puts "Error: Narwhal must be installed in order to execute CoffeeScripts."
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user