Skip to content

Commit 666e6e0

Browse files
author
Chris Brody
authored
no log of generated example options unless enabled (#257)
1 parent 1dc8245 commit 666e6e0

File tree

8 files changed

+17
-20
lines changed

8 files changed

+17
-20
lines changed

lib/lib.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ const generateWithNormalizedOptions = ({
109109
license: ${license}
110110
view: ${view}
111111
useAppleNetworking: ${useAppleNetworking}
112+
` + (generateExample
113+
? `
112114
generateExample: ${generateExample}
113115
exampleName: ${exampleName}
114116
writeExamplePodfile: ${writeExamplePodfile}
115-
`);
117+
` : ``));
116118

117119
// QUICK LOCAL INJECTION overwite of existing execSync / commandSync call from
118120
// mockable execa object for now (at least):

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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28-
generateExample: false
29-
exampleName: example
30-
writeExamplePodfile: false
31-
",
28+
",
3229
],
3330
},
3431
Object {

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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28-
generateExample: false
29-
exampleName: example
30-
writeExamplePodfile: false
31-
",
28+
",
3229
],
3330
},
3431
Object {

tests/with-mocks/cli/command/func/with-logging/with-error/__snapshots__/cli-command-with-logging-with-error.test.js.snap

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28-
generateExample: false
29-
exampleName: example
30-
writeExamplePodfile: false
31-
",
28+
",
3229
],
3330
},
3431
Object {
@@ -48,9 +45,9 @@ Array [
4845
"error": Array [
4946
"Error: ENOPERM not permitted
5047
at Object.ensureDir (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:9:27)
51-
at ensureDir (.../lib/lib.js:153:15)
52-
at generateLibraryModule (.../lib/lib.js:279:10)
53-
at generateWithNormalizedOptions (.../lib/lib.js:296:10)
48+
at ensureDir (.../lib/lib.js:155:15)
49+
at generateLibraryModule (.../lib/lib.js:281:10)
50+
at generateWithNormalizedOptions (.../lib/lib.js:298:10)
5451
at createLibraryModule (.../lib/cli-command.js:...
5552
at Object.func (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:62:9)
5653
",

tests/with-mocks/lib/create/with-example/with-logging/with-defaults/__snapshots__/create-with-example-with-defaults.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28+
2829
generateExample: true
2930
exampleName: example
3031
writeExamplePodfile: false
31-
",
32+
",
3233
],
3334
},
3435
Object {

tests/with-mocks/lib/create/with-example/with-logging/with-error/__snapshots__/with-yarn-error-logging.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28+
2829
generateExample: true
2930
exampleName: example
3031
writeExamplePodfile: false
31-
",
32+
",
3233
],
3334
},
3435
Object {

tests/with-mocks/lib/create/with-example/with-logging/with-null-options/with-null-prefix/__snapshots__/create-with-example-with-options.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Array [
2525
license: MIT
2626
view: false
2727
useAppleNetworking: false
28+
2829
generateExample: true
2930
exampleName: example
3031
writeExamplePodfile: false
31-
",
32+
",
3233
],
3334
},
3435
Object {

tests/with-mocks/lib/create/with-example/with-logging/with-options/__snapshots__/create-with-example-with-options.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ Array [
1919
license: ISC
2020
view: false
2121
useAppleNetworking: false
22+
2223
generateExample: true
2324
exampleName: example
2425
writeExamplePodfile: false
25-
",
26+
",
2627
],
2728
},
2829
Object {

0 commit comments

Comments
 (0)