From d22a0c255fb431bdd481688c3e72e9fde7833829 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 5 Nov 2025 17:02:35 -0800 Subject: [PATCH] fix path mismatch issue, always expand path --- pkg/wshrpc/wshserver/wshserver.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/wshrpc/wshserver/wshserver.go b/pkg/wshrpc/wshserver/wshserver.go index df7f7a29c..22187d7d7 100644 --- a/pkg/wshrpc/wshserver/wshserver.go +++ b/pkg/wshrpc/wshserver/wshserver.go @@ -442,7 +442,15 @@ func (ws *WshServer) FileShareCapabilityCommand(ctx context.Context, path string } func (ws *WshServer) FileRestoreBackupCommand(ctx context.Context, data wshrpc.CommandFileRestoreBackupData) error { - return filebackup.RestoreBackup(data.BackupFilePath, data.RestoreToFileName) + expandedBackupPath, err := wavebase.ExpandHomeDir(data.BackupFilePath) + if err != nil { + return fmt.Errorf("failed to expand backup file path: %w", err) + } + expandedRestorePath, err := wavebase.ExpandHomeDir(data.RestoreToFileName) + if err != nil { + return fmt.Errorf("failed to expand restore file path: %w", err) + } + return filebackup.RestoreBackup(expandedBackupPath, expandedRestorePath) } func (ws *WshServer) DeleteSubBlockCommand(ctx context.Context, data wshrpc.CommandDeleteBlockData) error {