Skip to content

Commit

Permalink
Implement platform specific URL format
Browse files Browse the repository at this point in the history
  • Loading branch information
rrmistry authored Jan 27, 2025
1 parent 8208304 commit d09ab61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build/lib/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ const baseHeaders = {
'X-Market-User-Id': '291C1CD0-051A-4123-9B4B-30D60EF52EE2',
};

export function fromMarketplace(serviceUrl: string, { name: extensionName, version, sha256, metadata }: IExtensionDefinition): Stream {
export function fromMarketplace(serviceUrl: string, { name: extensionName, version, sha256, metadata, platforms }: IExtensionDefinition): Stream {
const json = require('gulp-json-editor') as typeof import('gulp-json-editor');

const [publisher, name] = extensionName.split('.');
const url = `${serviceUrl}/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
const url = platforms && !platforms.includes(process.platform)
? `${serviceUrl}/publishers/${publisher}/vsextensions/${name}/${version}/vspackage?targetPlatform=${process.platform}`
: `${serviceUrl}/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;

fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');

Expand Down

0 comments on commit d09ab61

Please sign in to comment.