Skip to content

Commit 12b8be2

Browse files
adrienthieryGantMan
authored andcommitted
Add yarn global path (#222)
1 parent 6191d04 commit 12b8be2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

__tests__/command_helpers/checkSTDERR.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ describe('checkSTDERR', () => {
1010
expect(typeof output).toBe('string')
1111
expect(output.length).toBeGreaterThan(normal.length)
1212
})
13-
}
13+
})

__tests__/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ test('ensure build', async () => {
2222
expect(build().brand.mock.calls.length).toBe(1)
2323
expect(build().brand.mock.calls[0][0]).toBe('solidarity')
2424
expect(build().src.mock.calls.length).toBe(1)
25-
// Check local and globals for Windows/Darwin === 3 checks
26-
expect(build().plugins.mock.calls.length).toBe(3)
25+
// Check local and globals for Windows/Darwin + Yarn === 4 checks
26+
expect(build().plugins.mock.calls.length).toBe(4)
2727
expect(build().create.mock.calls.length).toBe(1)
2828
expect(build().run.mock.calls.length).toBe(1)
2929
})

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { build } from 'gluegun'
2+
const os = require('os')
23

34
module.exports = async (): Promise<void> => {
45
// setup the runtime
@@ -9,6 +10,7 @@ module.exports = async (): Promise<void> => {
910
.plugins('./node_modules', { matching: 'solidarity-*', hidden: true })
1011
// global installs
1112
.plugins('/usr/local/lib/node_modules', { matching: 'solidarity-*', hidden: true }) // Darwin
13+
.plugins(`${os.homedir()}/.config/yarn/global/node_modules`, { matching: 'solidarity-*', hidden: true }) // Yarn/Darwin
1214
.plugins(`${process.env.appdata}/npm/node_modules`, { matching: 'solidarity-*', hidden: true }) // Windows
1315
// for testing - force load a local plugin
1416
// .plugin('../solidarity-react-native')

0 commit comments

Comments
 (0)