Have Install-SsmsMin task clean up all older versions (#5670)

This commit is contained in:
Charles Gagnon
2019-05-28 15:21:19 -07:00
committed by GitHub
parent dc78a4af88
commit e8b20c86c1

View File

@@ -679,15 +679,16 @@ gulp.task('install-sqltoolsservice', () => {
});
function installSsmsMin() {
let config = require('../extensions/admin-tool-ext-win/src/config.json');
const config = require('../extensions/admin-tool-ext-win/src/config.json');
return platformInfo.getCurrent().then(p => {
let runtime = p.runtimeId;
const runtime = p.runtimeId;
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
var installer = new serviceDownloader(config);
let serviceInstallFolder = installer.getInstallDirectory(runtime);
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
return del(serviceInstallFolder + '/*').then(() => {
const serviceInstallFolder = installer.getInstallDirectory(runtime);
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
return del(serviceCleanupFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {