Skip to content

Commit

Permalink
Add support for yarn linked generators
Browse files Browse the repository at this point in the history
  • Loading branch information
appsforartists authored and SBoudrias committed Aug 9, 2017
1 parent 5092d40 commit 3dd2286
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/resolver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const path = require('path');
const fs = require('fs');
const os = require('os');
const _ = require('lodash');
const globby = require('globby');
const debug = require('debug')('yeoman:environment');
Expand Down Expand Up @@ -131,6 +132,13 @@ resolver.getNpmPaths = function () {
paths.push(path.join(__dirname, '../../../..'));
paths.push(path.join(__dirname, '../..'));

// Yarn's file structure looks like this:
//
// ~/.config/yarn/global/node_modules/yo/
// ~/.config/yarn/link/generator-i-made
//
paths.push(path.join(os.homedir(), '.config/yarn/link/'));

// Adds support for generator resolving when yeoman-generator has been linked
if (process.argv[1]) {
paths.push(path.join(path.dirname(process.argv[1]), '../..'));
Expand Down

0 comments on commit 3dd2286

Please sign in to comment.