fix(color): remove duplicate colors

This commit is contained in:
jguer 2020-08-17 00:09:43 +02:00
parent 1ccfd3f0b7
commit c305e1c196
No known key found for this signature in database
GPG key ID: 6D6CC9BEA8556B35
8 changed files with 57 additions and 100 deletions

View file

@ -216,7 +216,7 @@ func cleanAfter(bases []dep.Base) {
continue continue
} }
text.OperationInfoln(gotext.Get("Cleaning (%d/%d): %s", i+1, len(bases), cyan(dir))) text.OperationInfoln(gotext.Get("Cleaning (%d/%d): %s", i+1, len(bases), text.Cyan(dir)))
_, stderr, err := capture(passToGit(dir, "reset", "--hard", "HEAD")) _, stderr, err := capture(passToGit(dir, "reset", "--hard", "HEAD"))
if err != nil { if err != nil {
@ -232,7 +232,7 @@ func cleanAfter(bases []dep.Base) {
func cleanBuilds(bases []dep.Base) { func cleanBuilds(bases []dep.Base) {
for i, base := range bases { for i, base := range bases {
dir := filepath.Join(config.BuildDir, base.Pkgbase()) dir := filepath.Join(config.BuildDir, base.Pkgbase())
text.OperationInfoln(gotext.Get("Deleting (%d/%d): %s", i+1, len(bases), cyan(dir))) text.OperationInfoln(gotext.Get("Deleting (%d/%d): %s", i+1, len(bases), text.Cyan(dir)))
if err := os.RemoveAll(dir); err != nil { if err := os.RemoveAll(dir); err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} }

4
cmd.go
View file

@ -433,10 +433,10 @@ func syncList(cmdArgs *settings.Arguments, dbExecutor db.Executor) error {
if cmdArgs.ExistsArg("q", "quiet") { if cmdArgs.ExistsArg("q", "quiet") {
fmt.Println(name) fmt.Println(name)
} else { } else {
fmt.Printf("%s %s %s", magenta("aur"), bold(name), bold(green(gotext.Get("unknown-version")))) fmt.Printf("%s %s %s", text.Magenta("aur"), text.Bold(name), text.Bold(text.Green(gotext.Get("unknown-version"))))
if dbExecutor.LocalPackage(name) != nil { if dbExecutor.LocalPackage(name) != nil {
fmt.Print(bold(blue(gotext.Get(" [Installed]")))) fmt.Print(text.Bold(text.Blue(gotext.Get(" [Installed]"))))
} }
fmt.Println() fmt.Println()

View file

@ -63,8 +63,8 @@ func editor() (editor string, args []string) {
fallthrough fallthrough
default: default:
fmt.Fprintln(os.Stderr) fmt.Fprintln(os.Stderr)
text.Errorln(gotext.Get("%s is not set", bold(cyan("$EDITOR")))) text.Errorln(gotext.Get("%s is not set", text.Bold(text.Cyan("$EDITOR"))))
text.Warnln(gotext.Get("Add %s or %s to your environment variables", bold(cyan("$EDITOR")), bold(cyan("$VISUAL")))) text.Warnln(gotext.Get("Add %s or %s to your environment variables", text.Bold(text.Cyan("$EDITOR")), text.Bold(text.Cyan("$VISUAL"))))
for { for {
text.Infoln(gotext.Get("Edit PKGBUILD with?")) text.Infoln(gotext.Get("Edit PKGBUILD with?"))

View file

@ -262,7 +262,7 @@ func getPkgbuildsfromABS(pkgs []string, path string, dbExecutor db.Executor, for
continue continue
} }
default: default:
text.Warn(gotext.Get("%s already downloaded -- use -f to overwrite", cyan(name))) text.Warn(gotext.Get("%s already downloaded -- use -f to overwrite", text.Cyan(name)))
continue continue
} }
@ -271,13 +271,13 @@ func getPkgbuildsfromABS(pkgs []string, path string, dbExecutor db.Executor, for
if len(missing) != 0 { if len(missing) != 0 {
text.Warnln(gotext.Get("Missing ABS packages:"), text.Warnln(gotext.Get("Missing ABS packages:"),
cyan(strings.Join(missing, ", "))) text.Cyan(strings.Join(missing, ", ")))
} }
download := func(pkg string, url string) { download := func(pkg string, url string) {
defer wg.Done() defer wg.Done()
if _, err := gitDownloadABS(url, config.ABSDir, pkg); err != nil { if _, err := gitDownloadABS(url, config.ABSDir, pkg); err != nil {
errs.Add(errors.New(gotext.Get("failed to get pkgbuild: %s: %s", cyan(pkg), err.Error()))) errs.Add(errors.New(gotext.Get("failed to get pkgbuild: %s: %s", text.Cyan(pkg), err.Error())))
return return
} }
@ -285,9 +285,9 @@ func getPkgbuildsfromABS(pkgs []string, path string, dbExecutor db.Executor, for
mux.Lock() mux.Lock()
downloaded++ downloaded++
if err != nil { if err != nil {
errs.Add(errors.New(gotext.Get("failed to link %s: %s", cyan(pkg), stderr))) errs.Add(errors.New(gotext.Get("failed to link %s: %s", text.Cyan(pkg), stderr)))
} else { } else {
fmt.Fprintln(os.Stdout, gotext.Get("(%d/%d) Downloaded PKGBUILD from ABS: %s", downloaded, len(names), cyan(pkg))) fmt.Fprintln(os.Stdout, gotext.Get("(%d/%d) Downloaded PKGBUILD from ABS: %s", downloaded, len(names), text.Cyan(pkg)))
} }
mux.Unlock() mux.Unlock()
} }

View file

@ -482,7 +482,7 @@ nextpkg:
if len(incompatible) > 0 { if len(incompatible) > 0 {
text.Warnln(gotext.Get("The following packages are not compatible with your architecture:")) text.Warnln(gotext.Get("The following packages are not compatible with your architecture:"))
for pkg := range incompatible { for pkg := range incompatible {
fmt.Print(" " + cyan(basesMap[pkg].String())) fmt.Print(" " + text.Cyan(basesMap[pkg].String()))
} }
fmt.Println() fmt.Println()
@ -548,8 +548,8 @@ func pkgbuildNumberMenu(bases []dep.Base, installed stringset.StringSet) bool {
pkg := base.Pkgbase() pkg := base.Pkgbase()
dir := filepath.Join(config.BuildDir, pkg) dir := filepath.Join(config.BuildDir, pkg)
toPrint += fmt.Sprintf(magenta("%3d")+" %-40s", len(bases)-n, toPrint += fmt.Sprintf(text.Magenta("%3d")+" %-40s", len(bases)-n,
bold(base.String())) text.Bold(base.String()))
anyInstalled := false anyInstalled := false
for _, b := range base { for _, b := range base {
@ -557,11 +557,11 @@ func pkgbuildNumberMenu(bases []dep.Base, installed stringset.StringSet) bool {
} }
if anyInstalled { if anyInstalled {
toPrint += bold(green(gotext.Get(" (Installed)"))) toPrint += text.Bold(text.Green(gotext.Get(" (Installed)")))
} }
if _, err := os.Stat(dir); !os.IsNotExist(err) { if _, err := os.Stat(dir); !os.IsNotExist(err) {
toPrint += bold(green(gotext.Get(" (Build Files Exist)"))) toPrint += text.Bold(text.Green(gotext.Get(" (Build Files Exist)")))
askClean = true askClean = true
} }
@ -581,7 +581,7 @@ func cleanNumberMenu(bases []dep.Base, installed stringset.StringSet, hasClean b
} }
text.Infoln(gotext.Get("Packages to cleanBuild?")) text.Infoln(gotext.Get("Packages to cleanBuild?"))
text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", cyan(gotext.Get("[N]one")))) text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", text.Cyan(gotext.Get("[N]one"))))
cleanInput, err := getInput(config.AnswerClean) cleanInput, err := getInput(config.AnswerClean)
if err != nil { if err != nil {
return nil, err return nil, err
@ -656,14 +656,14 @@ func editDiffNumberMenu(bases []dep.Base, installed stringset.StringSet, diff bo
if diff { if diff {
text.Infoln(gotext.Get("Diffs to show?")) text.Infoln(gotext.Get("Diffs to show?"))
text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", cyan(gotext.Get("[N]one")))) text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", text.Cyan(gotext.Get("[N]one"))))
editInput, err = getInput(config.AnswerDiff) editInput, err = getInput(config.AnswerDiff)
if err != nil { if err != nil {
return nil, err return nil, err
} }
} else { } else {
text.Infoln(gotext.Get("PKGBUILDs to edit?")) text.Infoln(gotext.Get("PKGBUILDs to edit?"))
text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", cyan(gotext.Get("[N]one")))) text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", text.Cyan(gotext.Get("[N]one"))))
editInput, err = getInput(config.AnswerEdit) editInput, err = getInput(config.AnswerEdit)
if err != nil { if err != nil {
return nil, err return nil, err
@ -750,7 +750,7 @@ func showPkgbuildDiffs(bases []dep.Base, cloned stringset.StringSet) error {
} }
if !hasDiff { if !hasDiff {
text.Warnln(gotext.Get("%s: No changes -- skipping", cyan(base.String()))) text.Warnln(gotext.Get("%s: No changes -- skipping", text.Cyan(base.String())))
continue continue
} }
} }
@ -805,7 +805,7 @@ func parseSrcinfoFiles(bases []dep.Base, errIsFatal bool) (map[string]*gosrc.Src
pkg := base.Pkgbase() pkg := base.Pkgbase()
dir := filepath.Join(config.BuildDir, pkg) dir := filepath.Join(config.BuildDir, pkg)
text.OperationInfoln(gotext.Get("(%d/%d) Parsing SRCINFO: %s", k+1, len(bases), cyan(base.String()))) text.OperationInfoln(gotext.Get("(%d/%d) Parsing SRCINFO: %s", k+1, len(bases), text.Cyan(base.String())))
pkgbuild, err := gosrc.ParseFile(filepath.Join(dir, ".SRCINFO")) pkgbuild, err := gosrc.ParseFile(filepath.Join(dir, ".SRCINFO"))
if err != nil { if err != nil {
@ -875,7 +875,7 @@ func downloadPkgbuilds(bases []dep.Base, toSkip stringset.StringSet, buildDir st
downloaded++ downloaded++
text.OperationInfoln( text.OperationInfoln(
gotext.Get("PKGBUILD up to date, Skipping (%d/%d): %s", gotext.Get("PKGBUILD up to date, Skipping (%d/%d): %s",
downloaded, len(bases), cyan(base.String()))) downloaded, len(bases), text.Cyan(base.String())))
mux.Unlock() mux.Unlock()
return return
} }
@ -893,7 +893,7 @@ func downloadPkgbuilds(bases []dep.Base, toSkip stringset.StringSet, buildDir st
mux.Lock() mux.Lock()
downloaded++ downloaded++
text.OperationInfoln(gotext.Get("Downloaded PKGBUILD (%d/%d): %s", downloaded, len(bases), cyan(base.String()))) text.OperationInfoln(gotext.Get("Downloaded PKGBUILD (%d/%d): %s", downloaded, len(bases), text.Cyan(base.String())))
mux.Unlock() mux.Unlock()
} }
@ -924,7 +924,7 @@ func downloadPkgbuildsSources(bases []dep.Base, incompatible stringset.StringSet
err = show(passToMakepkg(dir, args...)) err = show(passToMakepkg(dir, args...))
if err != nil { if err != nil {
return errors.New(gotext.Get("error downloading sources: %s", cyan(base.String()))) return errors.New(gotext.Get("error downloading sources: %s", text.Cyan(base.String())))
} }
} }
@ -1075,7 +1075,7 @@ func buildInstallPkgbuilds(
return errors.New(gotext.Get("error making: %s", err)) return errors.New(gotext.Get("error making: %s", err))
} }
fmt.Fprintln(os.Stdout, gotext.Get("%s is up to date -- skipping", cyan(pkg+"-"+pkgVersion))) fmt.Fprintln(os.Stdout, gotext.Get("%s is up to date -- skipping", text.Cyan(pkg+"-"+pkgVersion)))
continue continue
} }
} }
@ -1086,7 +1086,7 @@ func buildInstallPkgbuilds(
return errors.New(gotext.Get("error making: %s", err)) return errors.New(gotext.Get("error making: %s", err))
} }
text.Warnln(gotext.Get("%s already made -- skipping build", cyan(pkg+"-"+pkgVersion))) text.Warnln(gotext.Get("%s already made -- skipping build", text.Cyan(pkg+"-"+pkgVersion)))
} else { } else {
args := []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"} args := []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"}

View file

@ -23,9 +23,9 @@ func (q aurQuery) printSearch(start int, dbExecutor db.Executor) {
if config.SearchMode == numberMenu { if config.SearchMode == numberMenu {
switch config.SortMode { switch config.SortMode {
case settings.TopDown: case settings.TopDown:
toprint += magenta(strconv.Itoa(start+i) + " ") toprint += text.Magenta(strconv.Itoa(start+i) + " ")
case settings.BottomUp: case settings.BottomUp:
toprint += magenta(strconv.Itoa(len(q)+start-i-1) + " ") toprint += text.Magenta(strconv.Itoa(len(q)+start-i-1) + " ")
default: default:
text.Warnln(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save")) text.Warnln(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save"))
} }
@ -34,24 +34,24 @@ func (q aurQuery) printSearch(start int, dbExecutor db.Executor) {
continue continue
} }
toprint += bold(text.ColorHash("aur")) + "/" + bold(q[i].Name) + toprint += text.Bold(text.ColorHash("aur")) + "/" + text.Bold(q[i].Name) +
" " + cyan(q[i].Version) + " " + text.Cyan(q[i].Version) +
bold(" (+"+strconv.Itoa(q[i].NumVotes)) + text.Bold(" (+"+strconv.Itoa(q[i].NumVotes)) +
" " + bold(strconv.FormatFloat(q[i].Popularity, 'f', 2, 64)+") ") " " + text.Bold(strconv.FormatFloat(q[i].Popularity, 'f', 2, 64)+") ")
if q[i].Maintainer == "" { if q[i].Maintainer == "" {
toprint += bold(red(gotext.Get("(Orphaned)"))) + " " toprint += text.Bold(text.Red(gotext.Get("(Orphaned)"))) + " "
} }
if q[i].OutOfDate != 0 { if q[i].OutOfDate != 0 {
toprint += bold(red(gotext.Get("(Out-of-date: %s)", text.FormatTime(q[i].OutOfDate)))) + " " toprint += text.Bold(text.Red(gotext.Get("(Out-of-date: %s)", text.FormatTime(q[i].OutOfDate)))) + " "
} }
if pkg := dbExecutor.LocalPackage(q[i].Name); pkg != nil { if pkg := dbExecutor.LocalPackage(q[i].Name); pkg != nil {
if pkg.Version() != q[i].Version { if pkg.Version() != q[i].Version {
toprint += bold(green(gotext.Get("(Installed: %s)", pkg.Version()))) toprint += text.Bold(text.Green(gotext.Get("(Installed: %s)", pkg.Version())))
} else { } else {
toprint += bold(green(gotext.Get("(Installed)"))) toprint += text.Bold(text.Green(gotext.Get("(Installed)")))
} }
} }
toprint += "\n " + q[i].Description toprint += "\n " + q[i].Description
@ -66,9 +66,9 @@ func (s repoQuery) printSearch(dbExecutor db.Executor) {
if config.SearchMode == numberMenu { if config.SearchMode == numberMenu {
switch config.SortMode { switch config.SortMode {
case settings.TopDown: case settings.TopDown:
toprint += magenta(strconv.Itoa(i+1) + " ") toprint += text.Magenta(strconv.Itoa(i+1) + " ")
case settings.BottomUp: case settings.BottomUp:
toprint += magenta(strconv.Itoa(len(s)-i) + " ") toprint += text.Magenta(strconv.Itoa(len(s)-i) + " ")
default: default:
text.Warnln(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save")) text.Warnln(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save"))
} }
@ -77,9 +77,9 @@ func (s repoQuery) printSearch(dbExecutor db.Executor) {
continue continue
} }
toprint += bold(text.ColorHash(res.DB().Name())) + "/" + bold(res.Name()) + toprint += text.Bold(text.ColorHash(res.DB().Name())) + "/" + text.Bold(res.Name()) +
" " + cyan(res.Version()) + " " + text.Cyan(res.Version()) +
bold(" ("+text.Human(res.Size())+ text.Bold(" ("+text.Human(res.Size())+
" "+text.Human(res.ISize())+") ") " "+text.Human(res.ISize())+") ")
packageGroups := dbExecutor.PackageGroups(res) packageGroups := dbExecutor.PackageGroups(res)
@ -89,9 +89,9 @@ func (s repoQuery) printSearch(dbExecutor db.Executor) {
if pkg := dbExecutor.LocalPackage(res.Name()); pkg != nil { if pkg := dbExecutor.LocalPackage(res.Name()); pkg != nil {
if pkg.Version() != res.Version() { if pkg.Version() != res.Version() {
toprint += bold(green(gotext.Get("(Installed: %s)", pkg.Version()))) toprint += text.Bold(text.Green(gotext.Get("(Installed: %s)", pkg.Version())))
} else { } else {
toprint += bold(green(gotext.Get("(Installed)"))) toprint += text.Bold(text.Green(gotext.Get("(Installed)")))
} }
} }
@ -150,7 +150,7 @@ func biggestPackages(dbExecutor db.Executor) {
} }
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
fmt.Printf("%s: %s\n", bold(pkgS[i].Name()), cyan(text.Human(pkgS[i].ISize()))) fmt.Printf("%s: %s\n", text.Bold(pkgS[i].Name()), text.Cyan(text.Human(pkgS[i].ISize())))
} }
// Could implement size here as well, but we just want the general idea // Could implement size here as well, but we just want the general idea
} }
@ -165,15 +165,15 @@ func localStatistics(dbExecutor db.Executor) error {
} }
text.Infoln(gotext.Get("Yay version v%s", yayVersion)) text.Infoln(gotext.Get("Yay version v%s", yayVersion))
fmt.Println(bold(cyan("==========================================="))) fmt.Println(text.Bold(text.Cyan("===========================================")))
text.Infoln(gotext.Get("Total installed packages: %s", cyan(strconv.Itoa(info.Totaln)))) text.Infoln(gotext.Get("Total installed packages: %s", text.Cyan(strconv.Itoa(info.Totaln))))
text.Infoln(gotext.Get("Total foreign installed packages: %s", cyan(strconv.Itoa(len(remoteNames))))) text.Infoln(gotext.Get("Total foreign installed packages: %s", text.Cyan(strconv.Itoa(len(remoteNames)))))
text.Infoln(gotext.Get("Explicitly installed packages: %s", cyan(strconv.Itoa(info.Expln)))) text.Infoln(gotext.Get("Explicitly installed packages: %s", text.Cyan(strconv.Itoa(info.Expln))))
text.Infoln(gotext.Get("Total Size occupied by packages: %s", cyan(text.Human(info.TotalSize)))) text.Infoln(gotext.Get("Total Size occupied by packages: %s", text.Cyan(text.Human(info.TotalSize))))
fmt.Println(bold(cyan("==========================================="))) fmt.Println(text.Bold(text.Cyan("===========================================")))
text.Infoln(gotext.Get("Ten biggest packages:")) text.Infoln(gotext.Get("Ten biggest packages:"))
biggestPackages(dbExecutor) biggestPackages(dbExecutor)
fmt.Println(bold(cyan("==========================================="))) fmt.Println(text.Bold(text.Cyan("===========================================")))
query.AURInfoPrint(remoteNames, config.RequestSplitN) query.AURInfoPrint(remoteNames, config.RequestSplitN)
@ -220,7 +220,7 @@ func printUpdateList(cmdArgs *settings.Arguments, dbExecutor db.Executor, enable
if cmdArgs.ExistsArg("q", "quiet") { if cmdArgs.ExistsArg("q", "quiet") {
fmt.Printf("%s\n", pkg.Name) fmt.Printf("%s\n", pkg.Name)
} else { } else {
fmt.Printf("%s %s -> %s\n", bold(pkg.Name), green(pkg.LocalVersion), green(pkg.RemoteVersion)) fmt.Printf("%s %s -> %s\n", text.Bold(pkg.Name), text.Green(pkg.LocalVersion), text.Green(pkg.RemoteVersion))
} }
delete(targets, pkg.Name) delete(targets, pkg.Name)
} }
@ -233,7 +233,7 @@ func printUpdateList(cmdArgs *settings.Arguments, dbExecutor db.Executor, enable
if cmdArgs.ExistsArg("q", "quiet") { if cmdArgs.ExistsArg("q", "quiet") {
fmt.Printf("%s\n", pkg.Name) fmt.Printf("%s\n", pkg.Name)
} else { } else {
fmt.Printf("%s %s -> %s\n", bold(pkg.Name), green(pkg.LocalVersion), green(pkg.RemoteVersion)) fmt.Printf("%s %s -> %s\n", text.Bold(pkg.Name), text.Green(pkg.LocalVersion), text.Green(pkg.RemoteVersion))
} }
delete(targets, pkg.Name) delete(targets, pkg.Name)
} }
@ -266,46 +266,3 @@ outer:
return nil return nil
} }
const (
redCode = "\x1b[31m"
greenCode = "\x1b[32m"
blueCode = "\x1b[34m"
magentaCode = "\x1b[35m"
cyanCode = "\x1b[36m"
boldCode = "\x1b[1m"
resetCode = "\x1b[0m"
)
func stylize(startCode, in string) string {
if text.UseColor {
return startCode + in + resetCode
}
return in
}
func red(in string) string {
return stylize(redCode, in)
}
func green(in string) string {
return stylize(greenCode, in)
}
func blue(in string) string {
return stylize(blueCode, in)
}
func cyan(in string) string {
return stylize(cyanCode, in)
}
func magenta(in string) string {
return stylize(magentaCode, in)
}
func bold(in string) string {
return stylize(boldCode, in)
}

View file

@ -156,7 +156,7 @@ func printIgnoringPackage(pkg db.RepoPackage, newPkgVersion string) {
left, right := upgrade.GetVersionDiff(pkg.Version(), newPkgVersion) left, right := upgrade.GetVersionDiff(pkg.Version(), newPkgVersion)
text.Warnln(gotext.Get("%s: ignoring package upgrade (%s => %s)", text.Warnln(gotext.Get("%s: ignoring package upgrade (%s => %s)",
cyan(pkg.Name()), text.Cyan(pkg.Name()),
left, right, left, right,
)) ))
} }
@ -203,7 +203,7 @@ func printLocalNewerThanAUR(
if !isDevelPackage(pkg) && alpm.VerCmp(pkg.Version(), aurPkg.Version) > 0 { if !isDevelPackage(pkg) && alpm.VerCmp(pkg.Version(), aurPkg.Version) > 0 {
text.Warnln(gotext.Get("%s: local (%s) is newer than AUR (%s)", text.Warnln(gotext.Get("%s: local (%s) is newer than AUR (%s)",
cyan(pkg.Name()), text.Cyan(pkg.Name()),
left, right, left, right,
)) ))
} }
@ -245,7 +245,7 @@ func upgradePkgs(aurUp, repoUp upgrade.UpSlice) (ignore, aurNames stringset.Stri
sort.Sort(repoUp) sort.Sort(repoUp)
sort.Sort(aurUp) sort.Sort(aurUp)
allUp := append(repoUp, aurUp...) allUp := append(repoUp, aurUp...)
fmt.Printf("%s"+bold(" %d ")+"%s\n", bold(cyan("::")), allUpLen, bold(gotext.Get("Packages to upgrade."))) fmt.Printf("%s"+text.Bold(" %d ")+"%s\n", text.Bold(text.Cyan("::")), allUpLen, text.Bold(gotext.Get("Packages to upgrade.")))
allUp.Print() allUp.Print()
text.Infoln(gotext.Get("Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)")) text.Infoln(gotext.Get("Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"))

2
vcs.go
View file

@ -148,7 +148,7 @@ func updateVCSData(vcsFilePath, pkgName string, sources []gosrc.ArchString, mux
} }
savedInfo[pkgName] = info savedInfo[pkgName] = info
text.Warnln(gotext.Get("Found git repo: %s", cyan(url))) text.Warnln(gotext.Get("Found git repo: %s", text.Cyan(url)))
err := saveVCSInfo(vcsFilePath) err := saveVCSInfo(vcsFilePath)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)