From 377e1d79b7d0a7d307df34b3ae9f30e86b3ccd2c Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Fri, 26 Nov 2021 11:53:57 +0000 Subject: [PATCH] guard license check --- publish-extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/publish-extension.js b/publish-extension.js index 80c903213..cb85c112e 100644 --- a/publish-extension.js +++ b/publish-extension.js @@ -28,7 +28,7 @@ const { createVSIX } = require('vsce'); const [namespace] = id.split('.'); let packagePath = context.repo; - if (extension.location) { + if (packagePath && extension.location) { packagePath = path.join(packagePath, extension.location); } @@ -103,7 +103,7 @@ const { createVSIX } = require('vsce'); } } // TODO(ak) check license is open-source - if (!await ovsx.isLicenseOk(packagePath, manifest)) { + if (!manifest?.license && !(packagePath && await ovsx.isLicenseOk(packagePath, manifest))) { throw new Error(`${extension.id}: license is missing`); }