Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #65: fix some shell escaping for building in a dir with spaces #164

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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