1 From bc22f7d43c12c5f79c71b0319666e71f29d61322 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= <kuba@kadziolka.net>
3 Date: Mon, 25 May 2020 18:53:04 +0200
4 Subject: [PATCH] Disable self-update.
6 Based on a Fedora patch by Elliott Sales de Andrade.
8 cli/cli.go | 44 +-------------------------------------------
9 1 file changed, 1 insertion(+), 43 deletions(-)
11 diff --git a/cli/cli.go b/cli/cli.go
12 index 4312eb0..5f62297 100644
15 @@ -10,13 +10,10 @@ import (
23 "github.com/blang/semver"
24 - "github.com/exercism/cli/debug"
25 - update "github.com/inconshreveable/go-update"
29 @@ -95,46 +92,7 @@ func (c *CLI) IsUpToDate() (bool, error) {
31 // Upgrade allows the user to upgrade to the latest version of the CLI.
32 func (c *CLI) Upgrade() error {
34 - OS = osMap[runtime.GOOS]
35 - ARCH = archMap[runtime.GOARCH]
38 - if OS == "" || ARCH == "" {
39 - return fmt.Errorf("unable to upgrade: OS %s ARCH %s", OS, ARCH)
42 - buildName := fmt.Sprintf("%s-%s", OS, ARCH)
43 - if BuildARCH == "arm" {
45 - return fmt.Errorf("unable to upgrade: arm version not found")
47 - buildName = fmt.Sprintf("%s-v%s", buildName, BuildARM)
50 - var downloadRC *bytes.Reader
51 - for _, a := range c.LatestRelease.Assets {
52 - if strings.Contains(a.Name, buildName) {
53 - debug.Printf("Downloading %s\n", a.Name)
55 - downloadRC, err = a.download()
57 - return fmt.Errorf("error downloading executable: %s", err)
62 - if downloadRC == nil {
63 - return fmt.Errorf("no executable found for %s/%s%s", BuildOS, BuildARCH, BuildARM)
66 - bin, err := extractBinary(downloadRC, OS)
72 - return update.Apply(bin, update.Options{})
73 + return fmt.Errorf("Please use Guix to update Exercism")
76 func (c *CLI) fetchLatestRelease() error {