File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import axios from 'axios' ;
2- import { MarkdownString } from 'vscode' ;
2+ import { extensions , MarkdownString } from 'vscode' ;
33import { ILogger } from './logging' ;
44
55export interface PuppetForgeModuleInfo {
@@ -18,6 +18,11 @@ export interface PuppetForgeModuleInfo {
1818 summary : string ;
1919}
2020
21+ function getVersion ( ) : string {
22+ const pkg = extensions . getExtension ( 'puppet.puppet-vscode' ) ;
23+ return pkg . packageJSON . version ;
24+ }
25+
2126export function buildMarkdown ( info : PuppetForgeModuleInfo ) : MarkdownString {
2227 const message = `## ${ info . name } \n
2328${ info . summary } \n
@@ -41,7 +46,7 @@ export function getPDKVersion(logger: ILogger): Promise<string> {
4146 } ,
4247 headers : {
4348 'Content-Type' : 'application/json;charset=UTF-8' ,
44- 'User-Agent' : ' puppet-vscode/0.27.1' ,
49+ 'User-Agent' : ` puppet-vscode/${ getVersion ( ) } ` ,
4550 } ,
4651 } )
4752 . then ( ( response ) => {
@@ -64,7 +69,7 @@ export function getModuleInfo(title: string, logger: ILogger): Promise<PuppetFor
6469 } ,
6570 headers : {
6671 'Content-Type' : 'application/json;charset=UTF-8' ,
67- 'User-Agent' : ' puppet-vscode/0.27.1' ,
72+ 'User-Agent' : ` puppet-vscode/${ getVersion ( ) } ` ,
6873 } ,
6974 } )
7075 . then ( ( response ) => {
You can’t perform that action at this time.
0 commit comments