wip: add support of building multiple packages at once

This commit is contained in:
2025-02-12 14:11:46 +03:00
parent 083df3c7aa
commit e773e3ee12
7 changed files with 309 additions and 218 deletions

View File

@@ -76,7 +76,8 @@ func BuildCmd() *cli.Command {
os.Exit(1)
}
var script, packageName string
var script string
var packages []string
// Проверяем, установлен ли флаг script (-s)
@@ -85,7 +86,7 @@ func BuildCmd() *cli.Command {
switch {
case c.IsSet("script"):
script = c.String("script")
packageName = c.String("script-package")
packages = append(packages, c.String("script-package"))
case c.IsSet("package"):
// TODO: handle multiple packages
packageInput := c.String("package")
@@ -107,7 +108,7 @@ func BuildCmd() *cli.Command {
if pkg[0].BasePkgName != "" {
script = filepath.Join(repoDir, pkg[0].Repository, pkg[0].BasePkgName, "alr.sh")
packageName = pkg[0].Name
packages = append(packages, pkg[0].Name)
} else {
script = filepath.Join(repoDir, pkg[0].Repository, pkg[0].Name, "alr.sh")
}
@@ -140,7 +141,7 @@ func BuildCmd() *cli.Command {
builder := build.NewBuilder(
ctx,
types.BuildOpts{
Package: packageName,
Packages: packages,
Script: script,
Manager: mgr,
Clean: c.Bool("clean"),