Skip to content

Commit b1b475b

Browse files
Merge pull request #465 from gjsjohnmurray/fix-464
fix #464 add objectscript.overwriteServerChanges setting
2 parents e528232 + 41a12d8 commit b1b475b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,11 @@
833833
"default": "cuk",
834834
"description": "Compilation flags."
835835
},
836+
"objectscript.overwriteServerChanges": {
837+
"type": "boolean",
838+
"default": false,
839+
"description": "Overwrite a changed server version without confirmation when importing the local file."
840+
},
836841
"objectscript.autoPreviewXML": {
837842
"type": "boolean",
838843
"default": false,

src/commands/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function importFile(file: CurrentFile, ignoreConflict?: boolean): Promise<
6969
const api = new AtelierAPI(file.uri);
7070
const content = file.content.split(/\r?\n/);
7171
const mtime = await checkChangedOnServer(file);
72-
ignoreConflict = ignoreConflict || mtime < 0;
72+
ignoreConflict = ignoreConflict || mtime < 0 || (file.uri.scheme === "file" && config("overwriteServerChanges"));
7373
return api
7474
.putDoc(
7575
file.name,

0 commit comments

Comments
 (0)