mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
30
extensions/postinstall.js
Normal file
30
extensions/postinstall.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const toDelete = new Set(['tsc.js', 'tsserverlibrary.js', 'typescriptServices.js']);
|
||||
|
||||
const root = path.join(__dirname, 'node_modules', 'typescript', 'lib');
|
||||
for (let name of fs.readdirSync(root)) {
|
||||
if (name === 'lib.d.ts' || name.match(/^lib\..*\.d\.ts$/) || name === 'protocol.d.ts') {
|
||||
continue;
|
||||
}
|
||||
if (name === 'typescript.js' || name === 'typescript.d.ts') {
|
||||
// used by html and extension editing
|
||||
continue;
|
||||
}
|
||||
|
||||
if (toDelete.has(name) || name.match(/\.d\.ts$/)) {
|
||||
try {
|
||||
fs.unlinkSync(path.join(root, name));
|
||||
console.log(`removed '${path.join(root, name)}'`);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user