Skip to content

Commit

Permalink
Clean up node path prepending (#7057)
Browse files Browse the repository at this point in the history
* Delete unused scriptsPrependNodePath config option.

#6382 (e905f74) made this option obsolete.

* Do not prepend the node exec path.

#6382 (e905f74) made this unnecessary.

* Update CHANGELOG.md

* Clarify in changelog the --scripts-prepend-node-path is removed because it is obsolete

The current behavior after this PR is not to make `--scripts-prepend-node-path` always on, but to have a better default behavior than the option provided.
  • Loading branch information
jasongrout authored and arcanis committed Mar 8, 2019
1 parent 379ed0a commit bb9741a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

## Master

- Removes `--scripts-prepend-node-path` as Yarn's default behavior makes this obsolete

[#7057](https://github.com/yarnpkg/yarn/pull/7057/files) - [**Jason Grout**](https://github.com/jasongrout)

- Fixes the advisory link printed by `yarn audit`

[#7091](https://github.com/yarnpkg/yarn/pull/7091) - [**Jakob Krigovsky**](https://github.com/sonicdoe)
Expand Down
5 changes: 0 additions & 5 deletions src/config.js
Expand Up @@ -50,7 +50,6 @@ export type ConfigOptions = {
nonInteractive?: boolean,
enablePnp?: boolean,
disablePnp?: boolean,
scriptsPrependNodePath?: boolean,
offlineCacheFolder?: string,

enableDefaultRc?: boolean,
Expand Down Expand Up @@ -177,8 +176,6 @@ export default class Config {
plugnplayUnplugged: Array<string>;
plugnplayPurgeUnpluggedPackages: boolean;

scriptsPrependNodePath: boolean;

workspacesEnabled: boolean;
workspacesNohoistEnabled: boolean;

Expand Down Expand Up @@ -484,8 +481,6 @@ export default class Config {
// $FlowFixMe$
this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY;

this.scriptsPrependNodePath = !!opts.scriptsPrependNodePath;

this.requestManager.setOptions({
offline: !!opts.offline && !opts.preferOffline,
captureHar: !!opts.captureHar,
Expand Down
7 changes: 0 additions & 7 deletions src/util/execute-lifecycle-script.js
Expand Up @@ -164,13 +164,6 @@ export async function makeEnv(
const envPath = env[constants.ENV_PATH_KEY];
const pathParts = envPath ? envPath.split(path.delimiter) : [];

// Include the directory that contains node so that we can guarantee that the scripts
// will always run with the exact same Node release than the one use to run Yarn
const execBin = path.dirname(process.execPath);
if (pathParts.indexOf(execBin) === -1) {
pathParts.unshift(execBin);
}

// Include node-gyp version that was bundled with the current Node.js version,
// if available.
pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
Expand Down

0 comments on commit bb9741a

Please sign in to comment.