Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Try to detect yarn from the install location.
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda committed Oct 12, 2016
1 parent ed169e7 commit 8fe8308
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ var welcomeMessage =
'getstorybook - the simplest way to add a storybook to your project.';
logger.log(chalk.inverse('\n ' + welcomeMessage + ' \n'));

var useYarn = Boolean(program.useYarn) || /\.yarn-cache/.test(__dirname);

var npmOptions = {
useYarn: Boolean(program.useYarn)
useYarn: useYarn
};

var runStorybookCommand = program.useYarn? 'yarn run storybook' : 'npm run storybook';
var runStorybookCommand = useYarn? 'yarn run storybook' : 'npm run storybook';

// Update notify code.
updateNotifier({
Expand Down

0 comments on commit 8fe8308

Please sign in to comment.