mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 09:35:41 -05:00
19 lines
843 B
TypeScript
19 lines
843 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { buffer } from 'vs/platform/node/zip';
|
|
import { localize } from 'vs/nls';
|
|
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
|
|
|
export function getManifest(vsix: string): Promise<IExtensionManifest> {
|
|
return buffer(vsix, 'extension/package.json')
|
|
.then(buffer => {
|
|
try {
|
|
return JSON.parse(buffer.toString('utf8'));
|
|
} catch (err) {
|
|
throw new Error(localize('invalidManifest', "VSIX invalid: package.json is not a JSON file."));
|
|
}
|
|
});
|
|
} |