Skip to content

Commit

Permalink
Fix issue on path option and undefined platforms (VoxaAI#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmberrios committed Jun 4, 2019
1 parent f025aa1 commit 311d650
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
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

0 comments on commit 311d650

Please sign in to comment.