Move directories

This commit is contained in:
2025-05-03 10:47:32 +03:00
parent eb8db1bc99
commit 4a8c4e22ec
3 changed files with 11 additions and 5 deletions
+7 -1
View File
@@ -60,7 +60,13 @@ func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks bo
gid = os.Getgid()
}
tempDirectory := path.Join(homeDir, ".cache/bpm/compilation/", bpmpkg.PkgInfo.Name)
// Set temporary directory
var tempDirectory string
if os.Getuid() == 0 {
tempDirectory = path.Join("/var/cache/bpm/compilation/", bpmpkg.PkgInfo.Name)
} else {
tempDirectory = path.Join(homeDir, ".cache/bpm/compilation/", bpmpkg.PkgInfo.Name)
}
// Ensure temporary directory does not exist
if _, err := os.Stat(tempDirectory); err == nil {