mirror of
https://github.com/zhou-yusen/Moving-Note.git
synced 2026-07-22 07:45:22 +00:00
Fix review errors: eslint descriptions, minAppVersion, trashFile args
- Add descriptions to eslint-disable comments (-- required by linter) - Bump minAppVersion to 1.4.0 (trashFile and setDisabled require it) - Fix trashFile calls: remove extra boolean argument (only takes file)
This commit is contained in:
parent
11103f3acb
commit
9d66176f94
3 changed files with 6 additions and 6 deletions
|
|
@ -49,7 +49,7 @@ export class GitOperations {
|
|||
*/
|
||||
private run(args: string[]): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call -- Required to spawn git process, Node.js module not available via ES import
|
||||
const cp = require("child_process") as { spawn: (cmd: string, args: string[], opts: unknown) => ChildProcess };
|
||||
const child = cp.spawn("git", args, { cwd: this.cwd });
|
||||
let stdout = "";
|
||||
|
|
@ -100,9 +100,9 @@ export class GitOperations {
|
|||
*/
|
||||
private cleanStaleLocks(): void {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call -- Required to clean stale git lock files, Node.js module not available via ES import
|
||||
const fs = require("fs") as NodeFs;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call -- Required to construct file paths, Node.js module not available via ES import
|
||||
const path = require("path") as NodePath;
|
||||
const lockFile = path.join(this.cwd, ".git", "config.lock");
|
||||
if (fs.existsSync(lockFile)) {
|
||||
|
|
@ -226,7 +226,7 @@ export class GitOperations {
|
|||
async deleteConflictFile(vault: Vault): Promise<void> {
|
||||
const file = vault.getAbstractFileByPath(CONFLICT_FILE);
|
||||
if (file) {
|
||||
await this.app.fileManager.trashFile(file, true);
|
||||
await this.app.fileManager.trashFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ export class GitHubApiClient {
|
|||
// 删除本地文件
|
||||
const existing = vault.getAbstractFileByPath(file.filename);
|
||||
if (existing) {
|
||||
await this.app.fileManager.trashFile(existing, true);
|
||||
await this.app.fileManager.trashFile(existing);
|
||||
}
|
||||
count++;
|
||||
} else if (
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "moving-note",
|
||||
"name": "Moving Note",
|
||||
"version": "1.0.0",
|
||||
"minAppVersion": "1.2.0",
|
||||
"minAppVersion": "1.4.0",
|
||||
"description": "Sync your notes via Git on desktop and GitHub API on mobile. Simple, reliable, cross-device.",
|
||||
"author": "Yusen",
|
||||
"authorUrl": "https://github.com/zhou-yusen",
|
||||
|
|
|
|||
Loading…
Reference in a new issue