Skip to content

Commit

Permalink
Merge pull request #1280 from storybooks/1277-react-native-getstorybook
Browse files Browse the repository at this point in the history
Fix bug in RN gestorybook
  • Loading branch information
shilman authored Jun 15, 2017
2 parents 103c72e + ea6224a commit 5e1cbb3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/cli/generators/REACT_NATIVE/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const mergeDirs = require('merge-dirs').default;
const helpers = require('../../lib/helpers');
const path = require('path');
const shell = require('shelljs');
const latestVersion = require('latest-version');
const chalk = require('chalk');
const helpers = require('../../lib/helpers');

module.exports = latestVersion('@storybook/react-native').then(version => {
// copy all files from the template directory to project directory
Expand All @@ -13,7 +14,13 @@ module.exports = latestVersion('@storybook/react-native').then(version => {
const projectName =
dirname && dirname.slice('ios/'.length, dirname.length - '.xcodeproj'.length - 1);
if (projectName) {
shell.sed('-i', '%APP_NAME%', projectName, 'storybook/index.js');
shell.sed('-i', '%APP_NAME%', projectName, 'storybook/storybook.js');
} else {
helpers.paddedLog(
chalk.red(
'ERR: Could not determine project name, to fix: https://github.com/storybooks/storybook/issues/1277'
)
);
}

const packageJson = helpers.getPackageJson();
Expand Down

0 comments on commit 5e1cbb3

Please sign in to comment.