Fix "invalid cross-device link" error when running on a different filesystem (#1769)

* fix cross-device rename errors

* fallback to copy instead of always using it

* use tmp dir in data folder

* recreate tmp dir at startup
This commit is contained in:
Lerk
2022-03-08 01:30:40 +01:00
committed by GitHub
parent 88ed026eae
commit a7687c861e
5 changed files with 51 additions and 6 deletions

11
main.go
View File

@@ -47,6 +47,17 @@ func main() {
}
}
// Recreate the temp dir
if utils.DoesFileExists(config.TempDir) {
err := os.RemoveAll(config.TempDir)
if err != nil {
log.Fatalln("Unable to remove temp dir!")
}
}
if err := os.Mkdir(config.TempDir, 0700); err != nil {
log.Fatalln("Unable to create temp dir!", err)
}
configureLogging(*enableDebugOptions, *enableVerboseLogging)
log.Infoln(config.GetReleaseString())