add create file for sync

This commit is contained in:
2025-05-16 00:16:03 +08:00
parent f26bc59e29
commit aab0662fbc
3 changed files with 46 additions and 28 deletions

View File

@@ -47,6 +47,12 @@ export class SyncBase {
return {} as Config;
}
}
getRelativeFile(filename?: string) {
if (!filename) return false;
const dir = this.#dir;
const file = path.join(dir, filename);
return { relative: path.relative(dir, file), absolute: file };
}
async canDone(syncType: SyncConfigType, type?: SyncConfigType) {
if (syncType === 'sync') return true;
return syncType === type;