Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function publish(options: PublishOptions = {}): Promise {
if (!options.registryUrl) {
options.registryUrl = process.env.OVSX_REGISTRY_URL;
}
if (!options.pat) {
options.pat = process.env.OVSX_PAT;
}
if (!options.extensionFile) {
options.extensionFile = await createTempFile({ postfix: '.vsix' });
await createVSIX({
cwd: options.packagePath,
packagePath: options.extensionFile,
baseContentUrl: options.baseContentUrl,
baseImagesUrl: options.baseImagesUrl,
useYarn: options.yarn
});
console.log(); // new line
}
const registry = new Registry({ url: options.registryUrl });
const extension = await registry.publish(options.extensionFile, options.pat);
if (extension.error) {
throw new Error(extension.error);
}
console.log(`\ud83d\ude80 Published ${extension.publisher}.${extension.name} v${extension.version}`);
}
gulp.task('vsce-package', () => {
const cliOptions = minimist(process.argv.slice(2));
const packageOptions = {
packagePath: cliOptions.packagePath
};
return vsce.createVSIX(packageOptions);
});