Skip to content

Commit

Permalink
cleanup: use prompt helper for Android package id
Browse files Browse the repository at this point in the history
(internal prompt helper function)

and update test snapshots

ref:pr #25
  • Loading branch information
Christopher J. Brody committed Mar 1, 2020
1 parent d7c0387 commit df3d44c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
3 changes: 1 addition & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,10 @@ Promise.resolve().then(async () => {

const { androidPackageId } =
platforms.indexOf('android') !== -1
? await prompts({
? await prompt({
type: 'text',
name: 'androidPackageId',
message: 'What is the desired Android package id?',
onState,
initial: 'com.demo',
validate: androidPackageId => androidPackageId.length > 0
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ Array [
},
Object {
"prompts": Object {
"args": Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
"args": Array [
Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
],
},
},
Object {
Expand Down
18 changes: 10 additions & 8 deletions tests/no-example/__snapshots__/no-example-with-log.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ Array [
},
Object {
"prompts": Object {
"args": Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
"args": Array [
Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
],
},
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ Array [
},
Object {
"prompts": Object {
"args": Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
"args": Array [
Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
],
},
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ Array [
},
Object {
"prompts": Object {
"args": Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
"args": Array [
Object {
"initial": "com.demo",
"message": "What is the desired Android package id?",
"name": "androidPackageId",
"onState": [Function],
"type": "text",
"validate": [Function],
},
],
},
},
Object {
Expand Down

0 comments on commit df3d44c

Please sign in to comment.