Skip to content

Commit ed280db

Browse files
committed
Fix ".bin" not linked when preparing a git dependency, reported in yarnpkg#3553
1 parent fe34bb0 commit ed280db

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

__tests__/fetchers.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test('GitFetcher.fetch with prepare script', async () => {
8383
{
8484
type: 'git',
8585
reference: 'https://github.com/Volune/test-js-git-repo',
86-
hash: '96e838bcc908ed424666b4b04efe802fd4c8bccd',
86+
hash: '0e56593e326069ed4bcec8126bb48a1891215c57',
8787
registry: 'npm',
8888
},
8989
(await Config.create()),
@@ -95,6 +95,8 @@ test('GitFetcher.fetch with prepare script', async () => {
9595
expect(dependencyName).toBe('beeper');
9696
// The file "prepare.js" is not in "files" list
9797
expect(await fs.exists(path.join(dir, 'prepare.js'))).toBe(false);
98+
// Check the dependency with a bin script was correctly executed
99+
expect(await fs.exists(path.join(dir, 'testscript.output.txt'))).toBe(true);
98100
// Check executed lifecycle scripts
99101
expect(await fs.exists(path.join(dir, 'generated', 'preinstall'))).toBe(true);
100102
expect(await fs.exists(path.join(dir, 'generated', 'install'))).toBe(true);

src/fetchers/git-fetcher.js

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export default class GitFetcher extends BaseFetcher {
161161
const [prepareConfig, prepareLockFile] = await Promise.all([
162162
Config.create(
163163
{
164+
binLinks: true,
164165
cwd: prepareDirectory,
165166
disablePrepublish: true,
166167
},

0 commit comments

Comments
 (0)