Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app entrypoint bug in RN gestorybook #1280

Merged
merged 3 commits into from
Jun 15, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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