Skip to content

Commit

Permalink
Accept process.execPath as-is
Browse files Browse the repository at this point in the history
Remove red tape surrounding process.execPath
and use it as-is. In particular, do not try
to canonicalize the path returned by
process.execPath as this might be relative
in the restricted Linux environments
(for example using overlayfs).

We should be prepared to accept relative
or otherwise broken process.execPath and
have a faith it works (otherwise our
build scripts wouldn't be invoked
in the first place).

sass#1323
  • Loading branch information
saper committed Jan 2, 2016
1 parent ec18ef5 commit a4619bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
22 changes: 0 additions & 22 deletions lib/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,6 @@ function collectArguments(args) {
}
}

/**
* Get Runtime Info
*
* @api private
*/

function getRuntimeInfo() {
var execPath = fs.realpathSync(process.execPath); // resolve symbolic link

var runtime = execPath
.split(/[\\/]+/).pop()
.split('.').shift();

runtime = runtime === 'nodejs' ? 'node' : runtime;

return {
name: runtime,
execPath: execPath
};
}

/**
* Get binary name.
* If environment variable SASS_BINARY_NAME,
Expand Down Expand Up @@ -122,7 +101,6 @@ var sass = process.sass = {};

sass.binaryName = getBinaryName();
sass.binaryUrl = getBinaryUrl();
sass.runtime = getRuntimeInfo();

/**
* Get binary path.
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ function build(options) {
return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
})).concat(options.args);

console.log(['Building:', process.sass.runtime.execPath].concat(args).join(' '));
console.log(['Building:', process.execPath].concat(args).join(' '));

var proc = spawn(process.sass.runtime.execPath, args, {
var proc = spawn(process.execPath, args, {
stdio: [0, 1, 2]
});

Expand Down

0 comments on commit a4619bf

Please sign in to comment.