MCPcopy
hub / github.com/wavetermdev/waveterm / FileRestoreBackupCommand

Method FileRestoreBackupCommand

pkg/wshrpc/wshserver/wshserver.go:412–422  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.CommandFileRestoreBackupData)

Source from the content-addressed store, hash-verified

410}
411
412func (ws *WshServer) FileRestoreBackupCommand(ctx context.Context, data wshrpc.CommandFileRestoreBackupData) error {
413 expandedBackupPath, err := wavebase.ExpandHomeDir(data.BackupFilePath)
414 if err != nil {
415 return fmt.Errorf("failed to expand backup file path: %w", err)
416 }
417 expandedRestorePath, err := wavebase.ExpandHomeDir(data.RestoreToFileName)
418 if err != nil {
419 return fmt.Errorf("failed to expand restore file path: %w", err)
420 }
421 return filebackup.RestoreBackup(expandedBackupPath, expandedRestorePath)
422}
423
424func (ws *WshServer) GetTempDirCommand(ctx context.Context, data wshrpc.CommandGetTempDirData) (string, error) {
425 tempDir := os.TempDir()

Callers

nothing calls this directly

Calls 2

ExpandHomeDirFunction · 0.92
RestoreBackupFunction · 0.92

Tested by

no test coverage detected