Skip to content

Commit 3dd2286

Browse files
appsforartistsSBoudrias
authored andcommittedAug 9, 2017
Add support for yarn linked generators
Closes yeoman/generator#1032
1 parent 5092d40 commit 3dd2286

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎lib/resolver.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22
const path = require('path');
33
const fs = require('fs');
4+
const os = require('os');
45
const _ = require('lodash');
56
const globby = require('globby');
67
const debug = require('debug')('yeoman:environment');
@@ -131,6 +132,13 @@ resolver.getNpmPaths = function () {
131132
paths.push(path.join(__dirname, '../../../..'));
132133
paths.push(path.join(__dirname, '../..'));
133134

135+
// Yarn's file structure looks like this:
136+
//
137+
// ~/.config/yarn/global/node_modules/yo/
138+
// ~/.config/yarn/link/generator-i-made
139+
//
140+
paths.push(path.join(os.homedir(), '.config/yarn/link/'));
141+
134142
// Adds support for generator resolving when yeoman-generator has been linked
135143
if (process.argv[1]) {
136144
paths.push(path.join(path.dirname(process.argv[1]), '../..'));

0 commit comments

Comments
 (0)
Please sign in to comment.