Add 'keep' flag

This commit is contained in:
2025-10-17 21:58:26 +03:00
parent 45c536b326
commit c9e16d6df1
3 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -21,7 +21,7 @@ import (
var rootCompilationUID = "65534"
var rootCompilationGID = "65534"
func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks bool) (outputBpmPackages map[string]string, err error) {
func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks, keepCompilationFiles bool) (outputBpmPackages map[string]string, err error) {
// Initialize map
outputBpmPackages = make(map[string]string)
@@ -334,6 +334,11 @@ func CompileSourcePackage(archiveFilename, outputDirectory string, skipChecks bo
outputBpmPackages[pkgInfo.Name] = outputFilename
}
// Delete temporary directory
if !keepCompilationFiles {
os.RemoveAll(tempDirectory)
}
return outputBpmPackages, nil
}
+1 -1
View File
@@ -592,7 +592,7 @@ func (operation *BPMOperation) Execute(verbose, force bool) (err error) {
// Compile source package if not compiled already
if _, ok := operation.compiledPackages[pkgNameToInstall]; !ok {
outputBpmPackages, err := CompileSourcePackage(value.File, compiledDir, false)
outputBpmPackages, err := CompileSourcePackage(value.File, compiledDir, false, false)
if err != nil {
return fmt.Errorf("could not compile source package (%s): %s\n", value.File, err)
}