mirror of
https://github.com/Jguer/yay
synced 2024-10-01 13:53:32 +00:00
add debug mode
This commit is contained in:
parent
e4fdc9a4d4
commit
bc4732e9e1
|
@ -274,7 +274,7 @@ func (installer *Installer) handleLayer(ctx context.Context,
|
|||
}
|
||||
}
|
||||
|
||||
fmt.Println(syncDeps, syncExp)
|
||||
text.Debugln("syncDeps", syncDeps, "SyncExp", syncExp, "aurDeps", aurDeps, "aurExp", aurExp)
|
||||
|
||||
errShow := installer.installSyncPackages(ctx, cmdArgs, syncDeps, syncExp)
|
||||
if errShow != nil {
|
||||
|
|
4
main.go
4
main.go
|
@ -65,6 +65,10 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
if config.Debug {
|
||||
text.DebugMode = true
|
||||
}
|
||||
|
||||
if errS := config.RunMigrations(
|
||||
settings.DefaultMigrations(), config.Runtime.ConfigPath); errS != nil {
|
||||
text.Errorln(errS)
|
||||
|
|
|
@ -30,6 +30,7 @@ var NoConfirm = false
|
|||
|
||||
// Configuration stores yay's config.
|
||||
type Configuration struct {
|
||||
Runtime *Runtime `json:"-"`
|
||||
AURURL string `json:"aururl"`
|
||||
BuildDir string `json:"buildDir"`
|
||||
Editor string `json:"editor"`
|
||||
|
@ -54,6 +55,7 @@ type Configuration struct {
|
|||
RemoveMake string `json:"removemake"`
|
||||
SudoBin string `json:"sudobin"`
|
||||
SudoFlags string `json:"sudoflags"`
|
||||
Version string `json:"version"`
|
||||
RequestSplitN int `json:"requestsplitn"`
|
||||
CompletionInterval int `json:"completionrefreshtime"`
|
||||
MaxConcurrentDownloads int `json:"maxconcurrentdownloads"`
|
||||
|
@ -73,9 +75,8 @@ type Configuration struct {
|
|||
BatchInstall bool `json:"batchinstall"`
|
||||
SingleLineResults bool `json:"singlelineresults"`
|
||||
SeparateSources bool `json:"separatesources"`
|
||||
Runtime *Runtime `json:"-"`
|
||||
NewInstallEngine bool `json:"newinstallengine"`
|
||||
Version string `json:"version"`
|
||||
Debug bool `json:"debug"`
|
||||
}
|
||||
|
||||
// SaveConfig writes yay config to file.
|
||||
|
@ -224,6 +225,7 @@ func DefaultConfig(version string) *Configuration {
|
|||
SeparateSources: true,
|
||||
NewInstallEngine: false,
|
||||
Version: version,
|
||||
Debug: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,19 @@ const (
|
|||
opSymbol = "::"
|
||||
)
|
||||
|
||||
var cachedColumnCount = -1
|
||||
var (
|
||||
cachedColumnCount = -1
|
||||
DebugMode = false
|
||||
)
|
||||
|
||||
func Debugln(a ...interface{}) {
|
||||
if !DebugMode {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Fprint(os.Stdout, append([]interface{}{Bold(yellow("[DEBUG] "))}, a...)...)
|
||||
fmt.Fprintln(os.Stdout, ResetCode)
|
||||
}
|
||||
|
||||
func OperationInfoln(a ...interface{}) {
|
||||
fmt.Fprint(os.Stdout, append([]interface{}{Bold(Cyan(opSymbol + " ")), boldCode}, a...)...)
|
||||
|
|
Loading…
Reference in a new issue