Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
issue nodejs#65: fix some shell escaping for building in a dir with s…
Browse files Browse the repository at this point in the history
…paces
  • Loading branch information
trentm committed Nov 15, 2012
1 parent 365198b commit bbd979b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,16 @@ function configure (gyp, argv, callback) {
output_dir = buildDir
}

argv.push('-I', addon_gypi)
argv.push('-I', common_gypi)
function shellEscape(str) {
return str.replace(/(["\s'$`\\])/g, '\\$1');
};

argv.push('-I', shellEscape(addon_gypi))
argv.push('-I', shellEscape(common_gypi))
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
argv.push('-Dmodule_root_dir=' + process.cwd())
argv.push('-Dnode_root_dir=' + shellEscape(nodeDir))
argv.push('-Dmodule_root_dir=' + shellEscape(process.cwd()))
argv.push('--depth=.')

// tell gyp to write the Makefile/Solution files into output_dir
Expand Down

0 comments on commit bbd979b

Please sign in to comment.