Skip to content

Commit

Permalink
feat: add {optdepends} replacement for commands
Browse files Browse the repository at this point in the history
Allows users to pass a list of optional dependencies
to the install command.

This could be combined with a script to prompt for installation
of any of those optional dependencies.

Signed-off-by: moson-mo <[email protected]>
  • Loading branch information
moson-mo committed Nov 21, 2023
1 parent a462275 commit 12385a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/pacseek/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func (ps *UI) installPackage(pkg InfoRecord, installed bool) {
command += " " + pkg.Name
}

// replace optdepends
command = strings.Replace(command, "{optdepends}", strings.Join(pkg.OptDepends, " "), -1)

// replace {giturl} with AUR url if defined
if pkg.Source == "AUR" {
command = strings.Replace(command, "{giturl}", "https://aur.archlinux.org/"+pkg.PackageBase+".git", -1)
Expand Down

0 comments on commit 12385a4

Please sign in to comment.