mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 16:58:30 +00:00
fix path mismatch issue, always expand path (#2527)
This commit is contained in:
parent
58392f7601
commit
46218827c1
1 changed files with 9 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue