Skip to content

Commit

Permalink
fix:[#121] bug: desktop icons aren't exported for the sideloaded DEB …
Browse files Browse the repository at this point in the history
…packages
  • Loading branch information
muhdsalm authored and mirkobrombin committed Jun 27, 2024
1 parent 5e868d5 commit 3240d88
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion cmd/pico.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,30 @@ func runPicoCmd(command string, cmd *cobra.Command, args []string) error {
return err
}

if command == "install" || command == "sideload" {
if command == "sideload" {
// Remove the --fix-broken flag
args[0] = args[len(args)-1]
args = args[:len(args)-1]

// Change args from filenames to package names
packageNames := []string{}
for _, v := range args {
out, _ := pico.Exec(true, false, "dpkg-deb", "--info", v)
for _, w := range strings.Split(out, "\n") {
wordsInLine := strings.Split(w, " ")
if len(wordsInLine) > 1 && wordsInLine[1] == "Package:" {
packageName := wordsInLine[2]
packageNames = append(packageNames, packageName)
}
}
}
exportedN, err := pico.ExportDesktopEntries(packageNames...)
if err == nil {
cmdr.Info.Printfln(vso.Trans("pico.info.exportedApps"), exportedN)
}
}

if command == "install" {
exportedN, err := pico.ExportDesktopEntries(args...)
if err == nil {
cmdr.Info.Printfln(vso.Trans("pico.info.exportedApps"), exportedN)
Expand Down

0 comments on commit 3240d88

Please sign in to comment.