Skip to content

Commit 1dc8245

Browse files
author
Chris Brody
authored
show hint to generate example, if needed in CLI (#256)
1 parent c7ddef9 commit 1dc8245

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

lib/cli-command.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@ const normalizedOptions = require('./normalized-options');
44

55
const createLibraryModule = require('./lib');
66

7-
const postCreateInstructions = ({ moduleName, exampleName }) => {
8-
return `
7+
const postCreateInstructions = ({
8+
moduleName,
9+
generateExample,
10+
exampleName
11+
}) => `
912
====================================================
1013
YOU'RE ALL SET!
11-
14+
` + (generateExample
15+
? `
1216
To build and run iOS example project, do:
1317
----
1418
cd ${moduleName}/${exampleName}
1519
yarn
1620
react-native run-ios
1721
----
18-
`;
19-
};
22+
`
23+
: `
24+
${emoji.get('bulb')} next time consider using \`--generate-example\` to add a generated example!
25+
`);
2026

2127
module.exports = {
2228
name: 'create-library',

tests/with-mocks/cli/command/func/with-logging/with-bogus-platforms/bogus-name/__snapshots__/cli-command-with-bogus-platforms-name.test.js.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,7 @@ yarn-error.log
154154
====================================================
155155
YOU'RE ALL SET!
156156
157-
To build and run iOS example project, do:
158-
----
159-
cd react-native-alice-bobbi/undefined
160-
yarn
161-
react-native run-ios
162-
----
157+
💡 next time consider using \`--generate-example\` to add a generated example!
163158
",
164159
],
165160
},

tests/with-mocks/cli/command/func/with-logging/with-bogus-platforms/empty-string/__snapshots__/cli-command-with-empty-platforms-string.test.js.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,7 @@ yarn-error.log
154154
====================================================
155155
YOU'RE ALL SET!
156156
157-
To build and run iOS example project, do:
158-
----
159-
cd react-native-alice-bobbi/undefined
160-
yarn
161-
react-native run-ios
162-
----
157+
💡 next time consider using \`--generate-example\` to add a generated example!
163158
",
164159
],
165160
},

0 commit comments

Comments
 (0)