mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
added delete zip files code (#16230)
* added delete zip files code * removed space
This commit is contained in:
@@ -353,6 +353,11 @@ function renameVscodeLangpacks() {
|
|||||||
console.log('vscode pack is not in ADS yet: ' + langId);
|
console.log('vscode pack is not in ADS yet: ' + langId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//Delete any erroneous zip files found in vscode folder.
|
||||||
|
let globZipArray = glob.sync(path.join(locVSCODEFolder, '*.zip'));
|
||||||
|
globZipArray.forEach(element => {
|
||||||
|
fs.unlinkSync(element);
|
||||||
|
});
|
||||||
// Delete extension files in vscode language pack that are not in ADS.
|
// Delete extension files in vscode language pack that are not in ADS.
|
||||||
if (fs.existsSync(translationDataFolder)) {
|
if (fs.existsSync(translationDataFolder)) {
|
||||||
let totalExtensions = fs.readdirSync(path.join(translationDataFolder, 'extensions'));
|
let totalExtensions = fs.readdirSync(path.join(translationDataFolder, 'extensions'));
|
||||||
@@ -366,9 +371,9 @@ function renameVscodeLangpacks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Get list of md files in ADS langpack, to copy to vscode langpack prior to renaming.
|
//Get list of md files in ADS langpack, to copy to vscode langpack prior to renaming.
|
||||||
let globArray = glob.sync(path.join(locADSFolder, '*.md'));
|
let globMDArray = glob.sync(path.join(locADSFolder, '*.md'));
|
||||||
//Copy files to vscode langpack, then remove the ADS langpack, and finally rename the vscode langpack to match the ADS one.
|
//Copy files to vscode langpack, then remove the ADS langpack, and finally rename the vscode langpack to match the ADS one.
|
||||||
globArray.forEach(element => {
|
globMDArray.forEach(element => {
|
||||||
fs.copyFileSync(element, path.join(locVSCODEFolder, path.parse(element).base));
|
fs.copyFileSync(element, path.join(locVSCODEFolder, path.parse(element).base));
|
||||||
});
|
});
|
||||||
rimraf.sync(locADSFolder);
|
rimraf.sync(locADSFolder);
|
||||||
|
|||||||
@@ -375,6 +375,13 @@ export function renameVscodeLangpacks(): Promise<void> {
|
|||||||
console.log('vscode pack is not in ADS yet: ' + langId);
|
console.log('vscode pack is not in ADS yet: ' + langId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Delete any erroneous zip files found in vscode folder.
|
||||||
|
let globZipArray = glob.sync(path.join(locVSCODEFolder, '*.zip'));
|
||||||
|
globZipArray.forEach(element => {
|
||||||
|
fs.unlinkSync(element);
|
||||||
|
});
|
||||||
|
|
||||||
// Delete extension files in vscode language pack that are not in ADS.
|
// Delete extension files in vscode language pack that are not in ADS.
|
||||||
if (fs.existsSync(translationDataFolder)) {
|
if (fs.existsSync(translationDataFolder)) {
|
||||||
let totalExtensions = fs.readdirSync(path.join(translationDataFolder, 'extensions'));
|
let totalExtensions = fs.readdirSync(path.join(translationDataFolder, 'extensions'));
|
||||||
@@ -389,10 +396,10 @@ export function renameVscodeLangpacks(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Get list of md files in ADS langpack, to copy to vscode langpack prior to renaming.
|
//Get list of md files in ADS langpack, to copy to vscode langpack prior to renaming.
|
||||||
let globArray = glob.sync(path.join(locADSFolder, '*.md'));
|
let globMDArray = glob.sync(path.join(locADSFolder, '*.md'));
|
||||||
|
|
||||||
//Copy files to vscode langpack, then remove the ADS langpack, and finally rename the vscode langpack to match the ADS one.
|
//Copy files to vscode langpack, then remove the ADS langpack, and finally rename the vscode langpack to match the ADS one.
|
||||||
globArray.forEach(element => {
|
globMDArray.forEach(element => {
|
||||||
fs.copyFileSync(element, path.join(locVSCODEFolder,path.parse(element).base));
|
fs.copyFileSync(element, path.join(locVSCODEFolder,path.parse(element).base));
|
||||||
});
|
});
|
||||||
rimraf.sync(locADSFolder);
|
rimraf.sync(locADSFolder);
|
||||||
|
|||||||
Reference in New Issue
Block a user