1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

merged tanob's fix for installing outside of /usr/local without a /bin

This commit is contained in:
Jeremy Ashkenas 2010-03-31 21:30:14 -04:00
parent 0410748e2d
commit f86fca2739
3 changed files with 9 additions and 9 deletions

View file

@ -12,13 +12,13 @@ option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) -> task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) ->
base: options.prefix or '/usr/local' base: options.prefix or '/usr/local'
lib: base + '/lib/coffee-script' lib: "$base/lib/coffee-script"
bin: base + '/bin' bin: "$base/bin"
exec([ exec([
'mkdir -p ' + lib + ' ' + bin "mkdir -p $lib $bin"
'cp -rf bin lib LICENSE README package.json src vendor ' + lib "cp -rf bin lib LICENSE README package.json src vendor $lib"
'ln -sf ' + lib + '/bin/coffee ' + base + '/bin/coffee' "ln -sf $lib/bin/coffee $base/bin/coffee"
'ln -sf ' + lib + '/bin/cake ' + base + '/bin/cake' "ln -sf $lib/bin/cake $base/bin/cake"
].join(' && '), (err, stdout, stderr) -> ].join(' && '), (err, stdout, stderr) ->
if err then print stderr if err then print stderr
) )

View file

@ -54,8 +54,8 @@
exports.run = (function(code, options) { exports.run = (function(code, options) {
var __dirname, __filename; var __dirname, __filename;
module.filename = (__filename = options.source); module.filename = (__filename = options.source);
__dirname = path.dirname(__filename, eval(exports.compile(code, options))); __dirname = path.dirname(__filename);
return __dirname; return eval(exports.compile(code, options));
}); });
// Extend CoffeeScript with a custom language extension. It should hook in to // Extend CoffeeScript with a custom language extension. It should hook in to
// the **Lexer** (as a peer of any of the lexer's tokenizing methods), and // the **Lexer** (as a peer of any of the lexer's tokenizing methods), and

View file

@ -51,7 +51,7 @@ exports.nodes: (code) ->
# setting `__filename`, `__dirname`, and relative `require()`. # setting `__filename`, `__dirname`, and relative `require()`.
exports.run: ((code, options) -> exports.run: ((code, options) ->
module.filename: __filename: options.source module.filename: __filename: options.source
__dirname: path.dirname __filename __dirname: path.dirname(__filename)
eval exports.compile code, options eval exports.compile code, options
) )