mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-20 21:17:47 +08:00
feat(config): 支持完整配置导入导出
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//go:build windows
|
||||
|
||||
package client
|
||||
|
||||
import "golang.org/x/sys/windows"
|
||||
|
||||
func replaceExportFile(sourcePath, targetPath string) error {
|
||||
source, err := windows.UTF16PtrFromString(sourcePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
target, err := windows.UTF16PtrFromString(targetPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return windows.MoveFileEx(
|
||||
source,
|
||||
target,
|
||||
windows.MOVEFILE_REPLACE_EXISTING|windows.MOVEFILE_WRITE_THROUGH,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user