split-operation-description-fix (#99)
This commit is contained in:
Родитель
504bc6145e
Коммит
4cb6f4678a
|
@ -2,7 +2,7 @@ trigger:
|
|||
- master
|
||||
|
||||
variables:
|
||||
NodeVersion: '12.x'
|
||||
NodeVersion: '12.16.1'
|
||||
|
||||
jobs:
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ schedules:
|
|||
- master
|
||||
|
||||
variables:
|
||||
NodeVersion: '12.x'
|
||||
NodeVersion: '12.16.1'
|
||||
VAR_REPO_URL: $(Build.Repository.Uri)
|
||||
VAR_REPO_BRANCHNAME: $(Build.SourceBranchName)
|
||||
VAR_BUILD_NUMBER: $(Build.BuildNumber)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@autorest/clicommon",
|
||||
"version": "0.5.4",
|
||||
"version": "0.5.5",
|
||||
"description": "Autorest Azure Cli Common Module",
|
||||
"main": "dist/index.js",
|
||||
"engines": {
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
* Specify a SemVer range to ensure developers use a NodeJS version that is appropriate
|
||||
* for your repo.
|
||||
*/
|
||||
"nodeSupportedVersionRange": ">=8.9.4 <11.0.0",
|
||||
"nodeSupportedVersionRange": ">=8.9.4 <14.0.0",
|
||||
"ensureConsistentVersions": true,
|
||||
"projectFolderMinDepth": 1,
|
||||
"projectFolderMaxDepth": 2,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Host, Session, startSession } from "@azure-tools/autorest-extension-base";
|
||||
import { CodeModel, Operation, codeModelSchema, OperationGroup } from "@azure-tools/codemodel";
|
||||
import { CodeModel, Operation, codeModelSchema } from "@azure-tools/codemodel";
|
||||
import { Helper } from "../helper";
|
||||
import { CliConst, CliCommonSchema } from "../schema";
|
||||
import { NodeCliHelper, NodeExtensionHelper } from "../nodeHelper";
|
||||
|
@ -31,7 +31,7 @@ export class SplitOperation{
|
|||
// Link splitted operation to src opreation
|
||||
NodeExtensionHelper.setSplitOperationOriginalOperation(splittedOperation, operation);
|
||||
|
||||
this.updateSplitOperationDescription(splittedOperation, group);
|
||||
this.updateSplitOperationDescription(splittedOperation);
|
||||
splittedGroupOperations.push(splittedOperation);
|
||||
});
|
||||
|
||||
|
@ -43,20 +43,18 @@ export class SplitOperation{
|
|||
}
|
||||
}
|
||||
|
||||
private updateSplitOperationDescription(operation: Operation, group: OperationGroup): void {
|
||||
private updateSplitOperationDescription(operation: Operation): void {
|
||||
const create = 'Create';
|
||||
const update = 'Update';
|
||||
const opCliKey = NodeCliHelper.getCliKey(operation, '').toLowerCase();
|
||||
const createOrUpdate: string = opCliKey.endsWith('#create') ? create : opCliKey.endsWith('#update') ? update : null;
|
||||
if (!createOrUpdate) {
|
||||
return;
|
||||
|
||||
if (opCliKey.endsWith("#create")) {
|
||||
operation.language.default.description = operation.language.default.description.replace(/[cC]reates?( or |\/)[uU]pdates?|[uU]pdates?( or |\/)[cC]reates?/g, create);
|
||||
}
|
||||
|
||||
if (opCliKey.endsWith("#update")) {
|
||||
operation.language.default.description = operation.language.default.description.replace(/[cC]reates?( or |\/)[uU]pdates?|[uU]pdates?( or |\/)[cC]reates?|[cC]reates?/g, update);
|
||||
}
|
||||
|
||||
const groupCliKey = NodeCliHelper.getCliKey(group, '');
|
||||
const namingConvention: CliCommonSchema.NamingConvention = {
|
||||
glossary: []
|
||||
};
|
||||
operation.language.default.description = createOrUpdate + ' ' + Helper.singularize(namingConvention, groupCliKey);
|
||||
}
|
||||
|
||||
private async modifier(): Promise<void> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче