feat(library): backup to and restore from a zip file (#3571)

This commit is contained in:
Huang Xin
2026-03-21 01:27:52 +08:00
committed by GitHub
parent e8f70b896e
commit 91bc4ddec7
51 changed files with 1580 additions and 138 deletions
@@ -364,9 +364,10 @@ export class NodeAppService extends BaseAppService {
async saveFile(
_filename: string,
content: string | ArrayBuffer,
filepath: string,
options?: { filePath?: string; mimeType?: string },
): Promise<boolean> {
try {
const filepath = options?.filePath ?? '';
await fsp.mkdir(nodePath.dirname(filepath), { recursive: true });
if (typeof content === 'string') {
await fsp.writeFile(filepath, content, 'utf-8');