UNPKG

@autorest/go

Version:
25 lines 1.24 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as helpers from './helpers.js'; /** * Creates the content in version.go. * if version.go doesn't need to be created, the empty string is returned. * * @param module the module for which to generate version.go * @returns the contents of version.go or the empty string */ export function generateVersionInfo(module) { let text = helpers.contentPreamble(module, false); const indent = new helpers.Indentation(); text += 'const (\n'; // strip off any major version suffix. this is for telemetry // purposes, so all major versions coalesce into the same bucket text += `${indent.get()}moduleName = "${module.identity.replace(/\/v\d+$/, '')}"\n`; // for new modules, we seed the moduleVersion with a prerelease version text += `${indent.get()}moduleVersion = "v0.1.0"\n`; text += ')\n\n'; return text; } //# sourceMappingURL=version.js.map