Skip to content

Commit

Permalink
Clarify installation instructions (#9)
Browse files Browse the repository at this point in the history
This commit updates the installation instructions and the toolchain.
We also update the repository to use a recent version of Go.

Close #7
  • Loading branch information
olivere authored Nov 21, 2023
1 parent d5de97a commit acb1a3c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
name: Release

on:
pull_request:
push:
tags:
- '*'
- "v**"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
uses: actions/setup-go@v4

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
on: [push, pull_request]

name: Test

jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
go-version: [1.20.x, 1.21.x]
platform: [ubuntu-latest, windows-latest, macOS-latest]
name: Run ${{ matrix.go-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Test
run: go test -race -v ./...
14 changes: 6 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
env:
- GO111MODULE=on
- CGO_ENABLED=0

before:
hooks:
# you may remove this if you don't use vgo
- go mod tidy

builds:
- id: imgs
- id: imgls
main: ./cmd/imgls
binary: imgls
goos:
Expand Down Expand Up @@ -38,19 +39,16 @@ builds:
ignore:
- goos: darwin
goarch: 386

checksum:
name_template: '{{ .ProjectName }}_checksums.txt'

archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright © 2012-2019 Oliver Eilhard
Copyright © 2012-2023 Oliver Eilhard

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ Be sure to

![imgls](/img/imgls.png?raw=true "imgls")

# Installation
## Installation

To install `imgcat`, type:
To install `imgcat`, you should have a recent version of Go (1.21+ at the time of writing this), and type:

```go
GO111MODULE=on go get -u github.com/olivere/iterm2-imagetools/cmd/imgcat
go install github.com/olivere/iterm2-imagetools/cmd/imgcat@latest
```

To install `imgls`, type:

```go
GO111MODULE=on go get -u github.com/olivere/iterm2-imagetools/cmd/imgls
go install github.com/olivere/iterm2-imagetools/cmd/imgls@latest
```

# License
The binaries then get installed into the `$GOPATH/bin` directory (or `$HOME/go/bin` if `GOPATH` is not set; see `go help install`), which you can add to your `$PATH`.

## License

MIT-LICENSE. See [LICENSE](http://olivere.mit-license.org/)
or the LICENSE file provided in the repository for details.
3 changes: 1 addition & 2 deletions cmd/imgcat/imgcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -74,7 +73,7 @@ func displayLocalPicture(filename string) {
}

func display(r io.Reader) error {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/imgls/imgls.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -57,7 +56,7 @@ func displayLocalPicture(filename string) {
}

func display(filename string, r io.Reader) error {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
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
@@ -1,3 +1,3 @@
module github.com/olivere/iterm2-imagetools

go 1.12
go 1.20

0 comments on commit acb1a3c

Please sign in to comment.