Skip to content

Commit

Permalink
feat:warn users about missing LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewnt219 committed Oct 8, 2021
1 parent 2ca9ae7 commit 2304ec7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ class LicenseProcessor extends BaseProcessor {
this.vsix.license = null;
}

onFile(file: IFile): Promise<IFile> {
async onFile(file: IFile): Promise<IFile> {
if (!this.didFindLicense) {
let normalizedPath = util.normalize(file.path);

Expand All @@ -843,6 +843,12 @@ class LicenseProcessor extends BaseProcessor {
this.assets.push({ type: 'Microsoft.VisualStudio.Services.Content.License', path: normalizedPath });
this.vsix.license = normalizedPath;
this.didFindLicense = true;
} else {
util.log.warn(`LICENSE file not found`);

if (!/^y$/i.test(await util.read('Do you want to continue? [y/N] '))) {
throw new Error('Aborted');
}
}
}

Expand Down

0 comments on commit 2304ec7

Please sign in to comment.