Skip to content

Commit b409261

Browse files
eliperelmanarcanis
authored andcommitted
Add environment variables to spawned create process (#7127)
* Add environment variables to spawned create process * Add changelog for PR #7127 * Update CHANGELOG.md
1 parent 697a254 commit b409261

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa
1212

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

15+
- Exposes the script environment variables to `yarn create` spawned processes.
16+
17+
[#7127](https://github.com/yarnpkg/yarn/pull/7127) - [**Eli Perelman**](https://github.com/eliperelman)
18+
1519
## 1.15.2
1620

1721
The 1.15.1 doesn't exist due to a release hiccup.

src/cli/commands/create.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type Config from '../../config.js';
44
import {MessageError} from '../../errors.js';
55
import type {Reporter} from '../../reporters/index.js';
66
import * as child from '../../util/child.js';
7+
import {makeEnv} from '../../util/execute-lifecycle-script';
78
import {run as runGlobal, getBinFolder} from './global.js';
89

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

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

65-
await child.spawn(command, rest, {stdio: `inherit`, shell: true});
67+
await child.spawn(command, rest, {stdio: `inherit`, shell: true, env});
6668
}

0 commit comments

Comments
 (0)