Skip to content

Commit

Permalink
Merge pull request #114 from zyrouge/main
Browse files Browse the repository at this point in the history
  • Loading branch information
srevinsaju authored Aug 20, 2023
2 parents e963248 + 87a9ae5 commit ef44059
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Go
name: Build

on:
workflow_dispatch:
push:
branches: [ main ]
tags:
- v*.*

pull_request:
branches: [ main ]

Expand Down Expand Up @@ -50,14 +50,14 @@ jobs:
ARCH: ['386', 'amd64', 'arm', 'arm64']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19'
go-version: '>=1.21'

- name: Build
run: |
Expand Down
18 changes: 10 additions & 8 deletions appimage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package appimage

import (
"fmt"
"github.com/gabriel-vasile/mimetype"
"image"
_ "image/png"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"strings"

"github.com/gabriel-vasile/mimetype"

"github.com/AlecAivazis/survey/v2"
"github.com/adrg/xdg"
"github.com/srevinsaju/zap/config"
Expand Down Expand Up @@ -53,7 +53,7 @@ func (appimage AppImage) getBaseName() string {
* with the apps' basename and png as the Name */
func (appimage *AppImage) ExtractThumbnail(target string) {

dir, err := ioutil.TempDir("", "zap")
dir, err := os.MkdirTemp("", "zap")
if err != nil {
logger.Debug("Creating temporary directory for thumbnail extraction failed")
return
Expand All @@ -67,7 +67,7 @@ func (appimage *AppImage) ExtractThumbnail(target string) {
return
}

buf, err := os.Open(dirIcon)
buf, _ := os.Open(dirIcon)
logger.Debug("Trying to detect file type of the icon: supports .svg, .png")

// move to beginning of the DirIcon, since the image dimensions check might fail
Expand Down Expand Up @@ -205,7 +205,7 @@ func (appimage AppImage) Extract(dir string, relPath string) string {
// with the apps' basename and png as the Name */
func (appimage AppImage) ExtractDesktopFile() ([]byte, error) {

dir, err := ioutil.TempDir("", "zap")
dir, err := os.MkdirTemp("", "zap")
if err != nil {
logger.Debug("Creating temporary directory for thumbnail extraction failed")
return []byte{}, err
Expand All @@ -215,7 +215,7 @@ func (appimage AppImage) ExtractDesktopFile() ([]byte, error) {
logger.Debug("Trying to extract Desktop files")
desktopFile := appimage.Extract(dir, "*.desktop")

data, err := ioutil.ReadFile(desktopFile)
data, err := os.ReadFile(desktopFile)
if err != nil {
logger.Warnf("Reading desktop file failed %s", err)
return []byte{}, err
Expand Down Expand Up @@ -281,10 +281,12 @@ func (appimage *AppImage) ProcessDesktopFile(cfg config.Store) {
appImageIcon := desktopEntry.Key("Icon").String()
desktopEntry.Key("X-Zap-Id").SetValue(appimage.Executable)

// This does patch https://github.com/srevinsaju/zap/issues/92
// but, we use zap's saved icon for custom icon theme
if cfg.CustomIconTheme {
desktopEntry.Key("Icon").SetValue(appImageIcon)
} else {
desktopEntry.Key("Icon").SetValue(appimage.Executable)
desktopEntry.Key("Icon").SetValue(appimage.IconPath)
}

// set the name again, so that the name looks like
Expand All @@ -297,7 +299,7 @@ func (appimage *AppImage) ProcessDesktopFile(cfg config.Store) {
binDir := path.Join(xdg.Home, ".local", "bin")
binFile := path.Join(binDir, appimage.Executable)
desktopEntry.Key("Exec").SetValue(fmt.Sprintf("%s %%U", binFile))
desktopEntry.Key("TryExec").SetValue(fmt.Sprintf("%s", binFile))
desktopEntry.Key("TryExec").SetValue(binFile)

tempDesktopDir := path.Join(cfg.LocalStore, "desktop")
os.MkdirAll(tempDesktopDir, 0755)
Expand Down
11 changes: 5 additions & 6 deletions appimage/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -148,7 +147,7 @@ func Install(options types.InstallOptions, config config.Store) error {

targetAppImagePath := path.Join(config.LocalStore, asset.GetBaseName())
if options.UpdateInplace {
file, _ := ioutil.TempFile(config.LocalStore, "temp*.AppImage")
file, _ := os.CreateTemp(config.LocalStore, "temp*.AppImage")
tmpTargetImagePath = targetAppImagePath
targetAppImagePath = file.Name()
}
Expand Down Expand Up @@ -221,7 +220,7 @@ func Install(options types.InstallOptions, config config.Store) error {
}
indexFile = fmt.Sprintf("%s.json", path.Join(config.IndexStore, options.Executable))
logger.Debugf("Writing JSON index to %s", indexFile)
err = ioutil.WriteFile(indexFile, indexBytes, 0644)
err = os.WriteFile(indexFile, indexBytes, 0644)
if err != nil {
return err
}
Expand Down Expand Up @@ -407,7 +406,7 @@ func update(options types.Options, config config.Store) (*AppImage, error) {
}

logger.Debugf("Unmarshalling JSON from %s", indexFile)
indexBytes, err := ioutil.ReadFile(indexFile)
indexBytes, err := os.ReadFile(indexFile)
if err != nil {
return app, err
}
Expand Down Expand Up @@ -499,7 +498,7 @@ func update(options types.Options, config config.Store) (*AppImage, error) {
}

logger.Debugf("Writing to %s", indexFile)
err = ioutil.WriteFile(indexFile, newIdxBytes, 0644)
err = os.WriteFile(indexFile, newIdxBytes, 0644)
if err != nil {
return app, err
}
Expand Down Expand Up @@ -547,7 +546,7 @@ func Remove(options types.RemoveOptions, config config.Store) error {
bar := tui.NewProgressBar(7, "r")

logger.Debugf("Unmarshalling JSON from %s", indexFile)
indexBytes, err := ioutil.ReadFile(indexFile)
indexBytes, err := os.ReadFile(indexFile)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"runtime"
Expand Down Expand Up @@ -195,7 +195,7 @@ func selfUpdateCliContextWrapper(c *cli.Context) error {
fmt.Println("Failed to check for updates.")
return err
}
newVersionBytes, err := ioutil.ReadAll(r.Body)
newVersionBytes, err := io.ReadAll(r.Body)
if err != nil {
panic(err)
}
Expand Down
10 changes: 5 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package config

import (
"errors"
"github.com/AlecAivazis/survey/v2"
"github.com/srevinsaju/zap/daemon"
"github.com/srevinsaju/zap/internal/helpers"
"io/ioutil"
"os"
"path/filepath"
"strconv"

"github.com/AlecAivazis/survey/v2"
"github.com/srevinsaju/zap/daemon"
"github.com/srevinsaju/zap/internal/helpers"

"github.com/adrg/xdg"
"gopkg.in/ini.v1"
)
Expand Down Expand Up @@ -127,7 +127,7 @@ func NewZapConfig(configPath string) (*Store, error) {
}

// Init new YAML decode
configRaw, err := ioutil.ReadFile(configPath)
configRaw, err := os.ReadFile(configPath)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions daemon/systemd.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package daemon

import (
"github.com/adrg/xdg"
"io/ioutil"
"log"
"os"
"os/exec"
"path"
"strings"

"github.com/adrg/xdg"
)

// https://github.com/probonopd/go-appimage/blob/23ad67c727fb762867fe96db06d600a7cdaf297d/src/appimaged/prerequisites.go#L463
Expand Down Expand Up @@ -62,7 +62,7 @@ Environment=LAUNCHED_BY_SYSTEMD=1
WantedBy=default.target`)

logger.Debugf("Writing zapd.service to %s", pathToServiceDir)
err = ioutil.WriteFile(path.Join(pathToServiceDir, "zapd.service"), systemdService, 0644)
err = os.WriteFile(path.Join(pathToServiceDir, "zapd.service"), systemdService, 0644)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ require (
github.com/srevinsaju/appimage-update v0.1.5-ss2
github.com/urfave/cli/v2 v2.20.3
github.com/withmandala/go-log v0.1.0
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/net v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0
)
28 changes: 21 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -401,6 +401,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -439,8 +440,10 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -465,6 +468,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -519,15 +523,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -536,8 +546,11 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -594,6 +607,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
4 changes: 2 additions & 2 deletions index/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package index
import (
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"runtime"
"strconv"
Expand All @@ -30,7 +30,7 @@ func GetZapReleases(executable string, config config.Store) (*types.ZapReleases,
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
Usage: "Use --from as repository slug to fetch from GitHub",
},
&cli.BoolFlag{
Name: "select-first",
Name: "select-first",
Usage: "Disable all prompts, and select the first item from the prompt if there are more than one choice.",
},
&cli.BoolFlag{
Expand All @@ -84,9 +84,9 @@ func main() {
},
},
{
Name: "update",
Usage: "Update, downgrade or change a version of an AppImage",
Action: updateAppImageCliContextWrapper,
Name: "update",
Usage: "Update, downgrade or change a version of an AppImage",
Action: updateAppImageCliContextWrapper,
Aliases: []string{"u", "downgrade", "switch"},
Flags: []cli.Flag{
&cli.StringFlag{
Expand All @@ -95,7 +95,7 @@ func main() {
"of the appimage on your system",
},
&cli.BoolFlag{
Name: "select-first",
Name: "select-first",
Usage: "Disable all prompts, and select the first item from the prompt if there are more than one choice.",
},
&cli.BoolFlag{
Expand Down
Loading

0 comments on commit ef44059

Please sign in to comment.