This repository was archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ublue-os/listnest
feat: nested package list
- Loading branch information
Showing
4 changed files
with
74 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright © 2023 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/ublue-os/fleek/core" | ||
"github.com/vanilla-os/orchid/cmdr" | ||
) | ||
|
||
func NewListPackagesCommand() *cmdr.Command { | ||
cmd := cmdr.NewCommandRun( | ||
fleek.Trans("listPackages.use"), | ||
fleek.Trans("listPackages.long"), | ||
fleek.Trans("listPackages.short"), | ||
list, | ||
) | ||
return cmd | ||
} | ||
|
||
// initCmd represents the init command | ||
func list(cmd *cobra.Command, args []string) { | ||
|
||
conf, err := core.ReadConfig() | ||
cobra.CheckErr(err) | ||
|
||
cmdr.Info.Println(fleek.Trans("listPackages.userBling"), strings.ToUpper(conf.Bling)) | ||
switch conf.Bling { | ||
case "high": | ||
cmdr.Info.Println(fleek.Trans("listPackages.highBling")) | ||
case "default": | ||
cmdr.Info.Println(fleek.Trans("listPackages.defaultBling")) | ||
case "low": | ||
cmdr.Info.Println(fleek.Trans("listPackages.lowBling")) | ||
|
||
} | ||
if conf.Bling == "high" { | ||
for _, pkg := range core.HighPackages { | ||
fmt.Printf("\t%s\n", pkg) | ||
} | ||
} | ||
if conf.Bling == "default" || conf.Bling == "high" { | ||
|
||
for _, pkg := range core.DefaultPackages { | ||
fmt.Printf("\t%s\n", pkg) | ||
} | ||
} | ||
for _, pkg := range core.LowPackages { | ||
fmt.Printf("\t%s\n", pkg) | ||
} | ||
|
||
cmdr.Info.Println(fleek.Trans("listPackages.userInstalled")) | ||
|
||
for _, pkg := range conf.Packages { | ||
fmt.Printf("\t%s\n", pkg) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters