vault backup: 2022-12-23 08:12:17

Affected files:
.obsidian/plugins/obsidian-git/main.js
.obsidian/plugins/obsidian-git/manifest.json
.obsidian/plugins/obsidian-hider/manifest.json
.obsidian/workspace.json
This commit is contained in:
Andley Chang 2022-12-23 08:12:18 +08:00
parent bfb442a192
commit 91f0dec3b0
4 changed files with 48 additions and 23 deletions

View File

@ -31252,9 +31252,7 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
let status2;
let unstagedFiles;
if (this.gitManager instanceof SimpleGit) {
const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile);
if (file != null)
await this.app.vault.delete(file);
this.mayDeleteConflictFile();
status2 = await this.updateCachedStatus();
if (fromAutoBackup && status2.conflicted.length > 0) {
this.displayError(`Did not commit, because you have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}. Please resolve them and commit per command.`);
@ -31267,9 +31265,7 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
this.displayError(`Did not commit, because you have conflicts. Please resolve them and commit per command.`);
return false;
} else if (hadConflict) {
const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile);
if (file != null)
await this.app.vault.delete(file);
await this.mayDeleteConflictFile();
status2 = await this.updateCachedStatus();
changedFiles = [...status2.changed, ...status2.staged];
} else {
@ -31346,10 +31342,9 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
if (!await this.remotesAreSet()) {
return false;
}
const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile);
const hadConflict = this.localStorage.getConflict() === "true";
if (this.gitManager instanceof SimpleGit && file)
await this.app.vault.delete(file);
if (this.gitManager instanceof SimpleGit)
await this.mayDeleteConflictFile();
let status2;
if (this.gitManager instanceof SimpleGit && (status2 = await this.updateCachedStatus()).conflicted.length > 0) {
this.displayError(`Cannot push. You have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}`);
@ -31387,6 +31382,17 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
}
return pulledFiles.length != 0;
}
async mayDeleteConflictFile() {
const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile);
if (file) {
this.app.workspace.iterateAllLeaves((leaf) => {
if (leaf.view instanceof import_obsidian23.MarkdownView && leaf.view.file.path == file.path) {
leaf.detach();
}
});
await this.app.vault.delete(file);
}
}
async stageFile(file) {
if (!await this.isAllInitialized())
return false;
@ -31584,7 +31590,10 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
if (conflicted !== void 0) {
lines = [
"# Conflicts",
"Please resolve them and commit per command (This file will be deleted before the commit).",
"Please resolve them and commit them using the commands `Obsidian Git: Commit all changes` followed by `Obsidian Git: Push`",
"(This file will automatically be deleted before commit)",
"[[#Additional Instructions]] available below file list",
"",
...conflicted.map((e) => {
const file = this.app.vault.getAbstractFileByPath(e);
if (file instanceof import_obsidian23.TFile) {
@ -31593,7 +31602,18 @@ var ObsidianGit = class extends import_obsidian23.Plugin {
} else {
return `- Not a file: ${e}`;
}
})
}),
`
# Additional Instructions
I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text.
\`\`\`diff
<<<<<<< HEAD
File changes in local repository
=======
File changes in remote repository
>>>>>>> origin/main
\`\`\``
];
}
this.writeAndOpenFile(lines == null ? void 0 : lines.join("\n"));

View File

@ -5,5 +5,5 @@
"isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent",
"js": "main.js",
"version": "2.13.0"
"version": "2.14.0"
}

View File

@ -1,10 +1,11 @@
{
"id": "obsidian-hider",
"name": "Hider",
"version": "1.2.3",
"version": "1.2.4",
"minAppVersion": "0.16.0",
"description": "Hide UI elements such as tooltips, status, titlebar and more",
"author": "@kepano",
"authorUrl": "https://www.twitter.com/kepano",
"fundingUrl": "https://www.buymeacoffee.com/kepano",
"isDesktopOnly": false
}

View File

@ -11,11 +11,15 @@
"id": "a870b4adb412e005",
"type": "leaf",
"state": {
"type": "markdown",
"type": "canvas",
"state": {
"file": "Idioms.md",
"mode": "source",
"source": true
"file": "canvas.canvas",
"viewState": {
"x": 0,
"y": 0,
"zoom": 0,
"snapToGrid": false
}
}
}
}
@ -86,7 +90,7 @@
"state": {
"type": "outline",
"state": {
"file": "Idioms.md"
"file": "canvas.canvas"
}
}
},
@ -107,7 +111,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Idioms.md",
"file": "canvas.canvas",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -124,7 +128,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Idioms.md",
"file": "canvas.canvas",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -147,8 +151,9 @@
"workspaces:Manage workspace layouts": false
}
},
"active": "a870b4adb412e005",
"active": "47f03e690283089d",
"lastOpenFiles": [
"Idioms.md",
"canvas.canvas",
"Digital-Tools.md",
"48-Galatians/Gal.5.16-21.md",
@ -157,7 +162,6 @@
"48-Galatians/Gal.4.12-20.md",
"48-Galatians/Galatians-Interlinear.md",
"48-Galatians/Gal.4.8-11.md",
"48-Galatians/Gal.4.1-7.md",
"BBG4E/HW12-Key.md"
"48-Galatians/Gal.4.1-7.md"
]
}