mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
This commit is contained in:
@@ -10,6 +10,7 @@ import type * as azdataType from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as mssql from 'mssql';
|
||||
|
||||
import { promises as fs } from 'fs';
|
||||
import { Uri, window } from 'vscode';
|
||||
import { EntryType, IDatabaseReferenceProjectEntry, ISqlProject, ItemType } from 'sqldbproj';
|
||||
import { DataSource } from './dataSources/dataSources';
|
||||
@@ -445,6 +446,18 @@ export class Project implements ISqlProject {
|
||||
|
||||
TelemetryReporter.sendActionEvent(TelemetryViews.ProjectController, TelemetryActions.updateProjectForRoundtrip);
|
||||
|
||||
// due to bug in DacFx.Projects, if a backup file already exists this will fail
|
||||
// workaround is to rename the existing backup
|
||||
|
||||
if (await utils.exists(this.projectFilePath + '_backup')) {
|
||||
let counter = 2;
|
||||
while (await utils.exists(this.projectFilePath + '_backup' + counter)) {
|
||||
counter++;
|
||||
}
|
||||
|
||||
await fs.rename(this.projectFilePath + '_backup', this.projectFilePath + '_backup' + counter);
|
||||
}
|
||||
|
||||
const result = await this.sqlProjService.updateProjectForCrossPlatform(this.projectFilePath);
|
||||
this.throwIfFailed(result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user