Skip to content

Commit

Permalink
fix bad check wrt platform specific extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jul 21, 2021
1 parent a924c9e commit d3eb08a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function readManifestFromPackage(packagePath: string): Promise<Manifest> {
});
}

async function _publish(packagePath: string, pat: string, manifest: Manifest): Promise<void> {
async function _publish(packagePath: string, pat: string, manifest: Manifest, options: IPublishOptions): Promise<void> {
const api = await getGalleryAPI(pat);

const packageStream = fs.createReadStream(packagePath);
Expand All @@ -74,7 +74,7 @@ async function _publish(packagePath: string, pat: string, manifest: Manifest): P
}
}

if (extension && extension.versions.some(v => v.version === manifest.version)) {
if (!options.target && extension && extension.versions.some(v => v.version === manifest.version)) {
throw new Error(`${fullName} already exists. Version number cannot be the same.`);
}

Expand Down Expand Up @@ -136,7 +136,7 @@ export function publish(options: IPublishOptions = {}): Promise<any> {

const patPromise = options.pat ? Promise.resolve(options.pat) : getPublisher(manifest.publisher).then(p => p.pat);

return patPromise.then(pat => _publish(packagePath, pat, manifest));
return patPromise.then(pat => _publish(packagePath, pat, manifest, options));
});
}

Expand Down

0 comments on commit d3eb08a

Please sign in to comment.