mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 10:36:12 +00:00
Add 'keep' flag
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user