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:
parent
0410748e2d
commit
f86fca2739
3 changed files with 9 additions and 9 deletions
12
Cakefile
12
Cakefile
|
@ -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) ->
|
||||
base: options.prefix or '/usr/local'
|
||||
lib: base + '/lib/coffee-script'
|
||||
bin: base + '/bin'
|
||||
lib: "$base/lib/coffee-script"
|
||||
bin: "$base/bin"
|
||||
exec([
|
||||
'mkdir -p ' + lib + ' ' + bin
|
||||
'cp -rf bin lib LICENSE README package.json src vendor ' + lib
|
||||
'ln -sf ' + lib + '/bin/coffee ' + base + '/bin/coffee'
|
||||
'ln -sf ' + lib + '/bin/cake ' + base + '/bin/cake'
|
||||
"mkdir -p $lib $bin"
|
||||
"cp -rf bin lib LICENSE README package.json src vendor $lib"
|
||||
"ln -sf $lib/bin/coffee $base/bin/coffee"
|
||||
"ln -sf $lib/bin/cake $base/bin/cake"
|
||||
].join(' && '), (err, stdout, stderr) ->
|
||||
if err then print stderr
|
||||
)
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
exports.run = (function(code, options) {
|
||||
var __dirname, __filename;
|
||||
module.filename = (__filename = options.source);
|
||||
__dirname = path.dirname(__filename, eval(exports.compile(code, options)));
|
||||
return __dirname;
|
||||
__dirname = path.dirname(__filename);
|
||||
return eval(exports.compile(code, options));
|
||||
});
|
||||
// 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
|
||||
|
|
|
@ -51,7 +51,7 @@ exports.nodes: (code) ->
|
|||
# setting `__filename`, `__dirname`, and relative `require()`.
|
||||
exports.run: ((code, options) ->
|
||||
module.filename: __filename: options.source
|
||||
__dirname: path.dirname __filename
|
||||
__dirname: path.dirname(__filename)
|
||||
eval exports.compile code, options
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue