Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
update (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar Cruzado authored Aug 27, 2021
1 parent 2948518 commit 3faa20e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 22 deletions.
55 changes: 33 additions & 22 deletions bin/bst-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,39 @@ const questions = [
type: "list",
name: "platform",
message: "Select the platform you are developing for",
choices: [
{
name: "Alexa",
value: "alexa",
},
{
name: "Google",
value: "google",
},
{
name: "Phone",
value: "phone",
},
{
name: "Sms",
value: "sms",
},
{
name: "Whatsapp",
value: "whatsapp",
},
],
choices: (answers: any) => {
const platforms = [
{
name: "Alexa",
value: "alexa",
},
{
name: "Google",
value: "google",
}
];
if (answers["type"] === "unit") {
return platforms;
} else {
return platforms.concat(
[

{
name: "Phone",
value: "phone",
},
{
name: "Sms",
value: "sms",
},
{
name: "Whatsapp",
value: "whatsapp",
},
]
);
}
}
},
{
type: "input",
Expand Down
7 changes: 7 additions & 0 deletions lib/init/init-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export class InitUtil {
private getTestName(): string {
if (this.isMultilocale) {
return "firstTestName";
} else if (this.platform === "phone") {
return "Dial and ask for help";
} else if (["whatsapp", "sms"].indexOf(this.platform) > -1) {
return "Ask for help";
}
return "Launch and ask for help";
}
Expand All @@ -149,6 +153,9 @@ export class InitUtil {
if (platform === "phone") {
input = "$DIAL";
expected = `Welcome to ${this.projectName}`;
} else if (["sms", "whatsapp"].indexOf(platform) > -1) {
input = "hello";
expected = `Welcome to ${this.projectName}`;
} else {
input = `open ${this.projectName}`;
expected = `Welcome to ${this.projectName}`;
Expand Down

0 comments on commit 3faa20e

Please sign in to comment.