Skip to content

Commit

Permalink
fix createOrUpdateRegex (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou authored Sep 24, 2024
1 parent f925a81 commit ce0daf5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion powershell/plugins/create-commands-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ export /* @internal */ class Inferrer {

async addVariant(vname: string, body: Parameter | null, bodyParameterName: string, parameters: Array<Parameter>, operation: Operation, variant: CommandVariant, state: State, preOperations: Array<Operation> | undefined, commandType?: CommandType): Promise<CommandOperation> {
// beth: filter command description for New/Update command
const createOrUpdateRegex = /^(creates? or updates?)|^(creates?)|^(updates?)/i;
// positive test case: The operation to create or update the extension.
// negative test case: Starts an UpdateRun
const createOrUpdateRegex = /((create or update)|(creates or updates)|(create)|(update)|(creates)|(updates))([^a-zA-Z0-9])/gi;
operation.language.default.description = operation.language.default.description.replace(createOrUpdateRegex, `${variant.action.capitalize()}`);
const op = await this.addCommandOperation(vname, parameters, operation, variant, state, preOperations, commandType);

Expand Down

0 comments on commit ce0daf5

Please sign in to comment.