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

Test/fix sed sys variance #339

Merged
Merged
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
8 changes: 6 additions & 2 deletions test/non-interference/http-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ cp.execFileSync('git', ['clone', '--branch', process.version,
'https://github.com/nodejs/node.git', '--depth', '1', node_dir]);
fs.mkdirSync(path.join(node_dir, 'test', 'tmp'));
console.log('Turning off global checks');
cp.execFileSync('sed', ['-i', 's/exports.globalCheck = true/' +
// The use of the -i flag as '-i.bak' to specify a backup extension of '.bak'
// is needed to ensure that the command works on both Linux and OS X
cp.execFileSync('sed', ['-i.bak', 's/exports.globalCheck = true/' +
'exports.globalCheck = false/g', path.join(node_dir, 'test', 'common.js')]);
var test_glob = semver.satisfies(process.version, '0.12.x') ?
path.join(node_dir, 'test', 'simple', 'test-http*.js') :
Expand All @@ -66,7 +68,9 @@ glob(test_glob, function(err, files) {
console.log('Skipped: ' + files[testCount]);
continue;
}
cp.execFileSync('sed', ['-i', 's#\'use strict\';#' +
// The use of the -i flag as '-i.bak' to specify a backup extension of
// '.bak' is needed to ensure that the command works on both Linux and OS X
cp.execFileSync('sed', ['-i.bak', 's#\'use strict\';#' +
'\'use strict\';' + gcloud_require + '#g', files[testCount]]);
if (cp.spawnSync('grep', ['-q', gcloud_require, files[testCount]]).status) {
cp.execSync('echo "' + gcloud_require + '" | cat - ' + files[testCount] +
Expand Down