Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit ad2058c

Browse files
author
David Favretto
authored
Update default lgOutFolder value and add --force to bf luis:generate command (#3373)
1 parent 5d74083 commit ad2058c

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

tools/botskills/src/botskills-connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ luisFolder = args.luisFolder ? sanitizePath(args.luisFolder) : join(outFolder, '
139139
dispatchFolder = args.dispatchFolder ? sanitizePath(args.dispatchFolder) : join(outFolder, 'Deployment', 'Resources', 'Dispatch');
140140

141141
// lgOutFolder validation
142-
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services') : 'Services'));
142+
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services', 'DispatchLuis.ts') : join('Services', 'DispatchLuis.cs')));
143143

144144
// Initialize an instance of IConnectConfiguration to send the needed arguments to the connectSkill function
145145
const configuration: IConnectConfiguration = {

tools/botskills/src/botskills-disconnect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ dispatchFolder = args.dispatchFolder ?
111111

112112
// lgOutFolder validation
113113
lgOutFolder = args.lgOutFolder ?
114-
sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services') : 'Services'));
114+
sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services', 'DispatchLuis.ts') : join('Services', 'DispatchLuis.cs')));
115115

116116
// End of arguments validation
117117
// Initialize an instance of IDisconnectConfiguration to send the needed arguments to the disconnectSkill function

tools/botskills/src/botskills-refresh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ cognitiveModelsFile = args.cognitiveModelsFile || join(outFolder, (args.ts ? joi
7676
dispatchFolder = args.dispatchFolder ? sanitizePath(args.dispatchFolder) : join(outFolder, 'Deployment', 'Resources', 'Dispatch');
7777

7878
// lgOutFolder validation
79-
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services') : 'Services'));
79+
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services', 'DispatchLuis.ts') : join('Services', 'DispatchLuis.cs')));
8080

8181
// End of arguments validation
8282

tools/botskills/src/botskills-update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ luisFolder = args.luisFolder ? sanitizePath(args.luisFolder) : join(outFolder, '
139139
dispatchFolder = args.dispatchFolder ? sanitizePath(args.dispatchFolder) : join(outFolder, 'Deployment', 'Resources', 'Dispatch');
140140

141141
// lgOutFolder validation
142-
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services') : 'Services'));
142+
lgOutFolder = args.lgOutFolder ? sanitizePath(args.lgOutFolder) : join(outFolder, (args.ts ? join('src', 'Services', 'DispatchLuis.ts') : join('Services', 'DispatchLuis.cs')));
143143

144144
// End of arguments validation
145145

tools/botskills/src/functionality/refreshSkill.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export class RefreshSkill {
7070
const argumentValue: string = executionModelByCulture.get(argument) as string;
7171
luisGenerateCommand.push(...[argument, argumentValue]);
7272
});
73+
74+
// Force the bf luis:generate to overwrite the output file if it already exists
75+
luisGenerateCommand.push('--force');
7376
await this.runCommand(luisGenerateCommand, `Executing luisgen for the ${ dispatchName } file`);
7477
} catch (err) {
7578
throw new Error(`There was an error in the bf luis:generate:${ this.configuration.lgLanguage } command:\nCommand: ${ luisGenerateCommand.join(' ') }\n${ err }`);

tools/botskills/test/refresh.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Error: Mocked function throws an Error`);
144144

145145
strictEqual(errorList[errorList.length - 1], `There was an error while refreshing any Skill from the Assistant:
146146
Error: There was an error in the bf luis:generate:${configuration.lgLanguage} command:
147-
Command: bf luis:generate:${configuration.lgLanguage} --in "${configuration.dispatchFolder}\\en-us\\filleden-usDispatch.json" --out "${configuration.lgOutFolder}"
147+
Command: bf luis:generate:${configuration.lgLanguage} --in "${configuration.dispatchFolder}\\en-us\\filleden-usDispatch.json" --out "${configuration.lgOutFolder}" --force
148148
Error: Mocked function throws an Error`);
149149
});
150150
});

0 commit comments

Comments
 (0)