bpm-package: add '--force' flag

This commit is contained in:
2026-06-23 08:23:57 +03:00
parent d781c30146
commit 8034c7d7ea
+12 -17
View File
@@ -22,9 +22,10 @@ import (
var compile = flag.BoolP("compile", "c", false, "Compile BPM source package")
var verbose = flag.BoolP("verbose", "v", false, "Show additional information about the compilation process")
var skipCheck = flag.Bool("skip-checks", false, "Skip 'check' function while compiling")
var skipChecks = flag.Bool("skip-checks", false, "Skip 'check' function while compiling")
var keepCompilationFiles = flag.BoolP("keep", "k", false, "Keep compilation files after successful package compilation")
var installDepends = flag.BoolP("depends", "d", false, "Install package dependencies for compilation")
var force = flag.BoolP("force", "f", false, "Bypass warnings during package compilation")
var installPackage = flag.BoolP("install", "i", false, "Install compiled BPM package after compilation finishes")
var compilationJobs = flag.IntP("jobs", "j", 0, "Set the amount of concurrent processes to use for source package compilation")
var updateInfo = flag.BoolP("update-info", "u", false, "Update the info.yml file")
@@ -203,24 +204,18 @@ func compilePackage(archive string) {
// Setup compile command
args := make([]string, 0)
args = append(args, "compile")
if *verbose {
args = append(args, "-v")
addArg := func(condition bool, arg string) {
if condition {
args = append(args, arg)
}
if *skipCheck {
args = append(args, "-s")
}
if *keepCompilationFiles {
args = append(args, "-k")
}
if *installDepends {
args = append(args, "-d")
}
if *compilationJobs > 0 {
args = append(args, "-j"+strconv.Itoa(*compilationJobs))
}
if *yesAll {
args = append(args, "-y")
}
addArg(*verbose, "-v")
addArg(*skipChecks, "--skip-checks")
addArg(*keepCompilationFiles, "-k")
addArg(*installDepends, "-d")
addArg(*compilationJobs > 0, "-j"+strconv.Itoa(*compilationJobs))
addArg(*yesAll, "-y")
addArg(*force, "-f")
args = append(args, "--output-fd=3")
args = append(args, archive)
cmd := exec.Command("bpm", args...)