Skip to content

Commit

Permalink
Add environment variables to spawned create process (#7127)
Browse files Browse the repository at this point in the history
* Add environment variables to spawned create process

* Add changelog for PR #7127

* Update CHANGELOG.md
  • Loading branch information
eliperelman authored and arcanis committed Mar 24, 2019
1 parent 697a254 commit b409261
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

[#6724](https://github.com/yarnpkg/yarn/pull/6724) - [**Tom Milligan**](https://github.com/tommilligan)

- Exposes the script environment variables to `yarn create` spawned processes.

[#7127](https://github.com/yarnpkg/yarn/pull/7127) - [**Eli Perelman**](https://github.com/eliperelman)

## 1.15.2

The 1.15.1 doesn't exist due to a release hiccup.
Expand Down
4 changes: 3 additions & 1 deletion src/cli/commands/create.js
Expand Up @@ -4,6 +4,7 @@ import type Config from '../../config.js';
import {MessageError} from '../../errors.js';
import type {Reporter} from '../../reporters/index.js';
import * as child from '../../util/child.js';
import {makeEnv} from '../../util/execute-lifecycle-script';
import {run as runGlobal, getBinFolder} from './global.js';

const path = require('path');
Expand Down Expand Up @@ -61,6 +62,7 @@ export async function run(config: Config, reporter: Reporter, flags: Object, arg

const binFolder = await getBinFolder(config, {});
const command = path.resolve(binFolder, commandName);
const env = await makeEnv('create', config.cwd, config);

await child.spawn(command, rest, {stdio: `inherit`, shell: true});
await child.spawn(command, rest, {stdio: `inherit`, shell: true, env});
}

0 comments on commit b409261

Please sign in to comment.