From e23db23eae3ca55fb3356c4bbdbe31365ef755f6 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 17 Dec 2024 19:13:24 +0400 Subject: [PATCH] In install_vanilla_client() fixed messages. --- cmd/mccl/commands/install_command.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cmd/mccl/commands/install_command.go b/cmd/mccl/commands/install_command.go index 67d1bc9..89ac719 100755 --- a/cmd/mccl/commands/install_command.go +++ b/cmd/mccl/commands/install_command.go @@ -82,8 +82,8 @@ func (ic *InstallCommand) install_vanilla_client() error { } fmt.Printf("Version %s (%s) was chosen.\n", version.Id, version.Type) - fmt.Print("Retrieving a manifest file... ") manifestPath := path.Join(ic.DestDir, "versions", version.Id, version.Id+".json") + fmt.Print("Retrieving ", path.Join("versions", version.Id, version.Id+".json"), "... ") data, err = util.LoadOrDownloadFile(manifestPath, version.Url, version.Sha1, "sha1", -1) if err != nil { return err @@ -93,21 +93,19 @@ func (ic *InstallCommand) install_vanilla_client() error { if err != nil { return err } - fmt.Println("Done") if !util.IsFileExist(manifestPath) { - fmt.Print("Writing a manifest file to ", manifestPath, " ... ") if err := util.WriteFile(manifestPath, data); err != nil { return err } fmt.Println("Done") } else { - fmt.Println(manifestPath, "does exist. Skipping") + fmt.Println("does exist. Skipping") } clientPath := path.Join(ic.DestDir, "versions", manifst.Id, manifst.Id+".jar") + fmt.Print("Retrieving ", path.Join("versions", manifst.Id, manifst.Id+".jar"), "... ") if !util.IsFileExist(clientPath) { - fmt.Print("Retrieving and writing a client to ", clientPath, " ... ") data, err = util.LoadOrDownloadFile(clientPath, manifst.Downloads["client"].Url, manifst.Downloads["client"].Sha1, "sha1", manifst.Downloads["client"].Size) if err != nil { @@ -118,12 +116,11 @@ func (ic *InstallCommand) install_vanilla_client() error { } fmt.Println("Done") } else { - fmt.Println(clientPath, "does exist. Skipping") + fmt.Println("does exist. Skipping") } - fmt.Printf("Retrieving an asset index %s.json... ", manifst.AssetIndex.Id) + fmt.Print("Retrieving ", path.Join("assets", "indexes", manifst.AssetIndex.Id+".json"), "... ") assetIndexPath := path.Join(ic.DestDir, "assets", "indexes", manifst.AssetIndex.Id+".json") - data, err = util.LoadOrDownloadFile(assetIndexPath, manifst.AssetIndex.Url, manifst.AssetIndex.Sha1, "sha1", manifst.AssetIndex.Size) if err != nil { @@ -134,16 +131,14 @@ func (ic *InstallCommand) install_vanilla_client() error { if err != nil { return err } - fmt.Println("Done") if !util.IsFileExist(assetIndexPath) { - fmt.Printf("Writing an asset index %s to %s...", manifst.AssetIndex.Id, assetIndexPath) if err := util.WriteFile(assetIndexPath, data); err != nil { return err } fmt.Println("Done") } else { - fmt.Printf("%s does exist. Skip writing\n", assetIndexPath) + fmt.Print("does exist. Skip writing") } fmt.Print("Retrieving assets...") @@ -182,8 +177,8 @@ func (ic *InstallCommand) install_vanilla_client() error { if manifst.Logging.Client.Argument != "" { logConfPath := path.Join(ic.DestDir, "assets", "log_configs", manifst.Logging.Client.File.Id) + fmt.Print("Retrieving ", path.Join("assets", "log_configs", manifst.Logging.Client.File.Id), "... ") if !util.IsFileExist(logConfPath) { - fmt.Printf("Retrieving and writing %s...", logConfPath) data, err = util.LoadOrDownloadFile(logConfPath, manifst.Logging.Client.File.Url, manifst.Logging.Client.File.Sha1, "sha1", manifst.Logging.Client.File.Size) if err != nil {