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

Add environment variables to spawned create process #7127

Merged
merged 3 commits into from
Mar 24, 2019
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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});
}