fix path mismatch issue, always expand path (#2527)

This commit is contained in:
Mike Sawka 2025-11-07 13:09:38 -08:00 committed by GitHub
parent 58392f7601
commit 46218827c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {