Restrict backup pruning to directories whose names match the DWS stamp format (YYYYmmdd-HHMMSS with optional -N suffix) across all 8 installer surfaces (Go, npm, 4 shell, 2 PowerShell). Unknown directories in ~/.dws/skill-backups are now preserved. Also fixes Windows coverage test portability and covers the remaining macOS changed-code gap (retire warning loop in runUpgrade).
17 lines
315 B
Go
17 lines
315 B
Go
//go:build !windows
|
|
|
|
package upgrade
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func testCrossDeviceError() error {
|
|
return &os.LinkError{Op: "rename", Old: "src", New: "dst", Err: syscall.EXDEV}
|
|
}
|
|
|
|
func testNoReplaceUnsupportedErrors() []error {
|
|
return []error{syscall.EINVAL, syscall.ENOSYS, errNoReplaceRenameUnsupported}
|
|
}
|