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 issue on path option and undefined platforms #82

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
Fix issue on path option and undefined platforms
  • Loading branch information
rmberrios committed Jun 4, 2019
commit 212ec7dacf3fb40607ffe71588be5f066d6b4500
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Now alexa spec is splitted into smaller units testing specific functionality
- Fixed @sys. slots on dialogflow were converted into a different type
- Fixed issue on path option on the interaction command
- Fixed issue with platforms undefined

## [2.1.2] - 2019-05-08

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voxa-cli",
"version": "2.2.0-alpha1",
"version": "2.2.0-alpha2",
"description": "The Voxa CLI tools",
"bin": {
"voxa": "./bin/voxa.js"
Expand Down
5 changes: 3 additions & 2 deletions src/InteractionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,23 @@ function defaultOptions(interactionOptions: IInteractionOptions): IDefinedIntera
(acc: string[], next: any[]) => {
const key = next[0];
const value = next[1];
if (!_.isEmpty(value)) {
if (value) {
acc.push(key);
}
return acc;
},
[] as ISupportedPlatforms[]
)
.concat(platforms)
.filter()
.uniq()
.value() as ISupportedPlatforms[];

if (_.isEmpty(spreadsheets) && _.isEmpty(platforms)) {
throw Error("Spreadsheet were not specified in the right format");
}

platforms = platforms || DEFAULT_INTERACTION_OPTIONS.platforms;
platforms = _.isEmpty(platforms) ? DEFAULT_INTERACTION_OPTIONS.platforms : platforms;

return {
rootPath,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function action(cmd: any) {
let interaction = {} as any;
let auth = {} as any;
try {
interaction = require(interationPath);
interaction = await fs.readJSON(interationPath);
} catch (e) {
const sampleInteraction = {
spreadsheets: ["INTENT SPREADSHEET", "PUBLISHING SPREADSHEET"]
Expand Down