update build

This commit is contained in:
Celogeek 2021-12-12 18:27:06 +01:00
parent 188efdbfa1
commit 5b74921ced
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
4 changed files with 12 additions and 13 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
bin imgcat

View File

@ -1,15 +1,14 @@
SRC=./cmd
BINARY=imgcat
BINARY_SRC=$(SRC)/imgcat
SOURCES=$(shell find $(BINARY_SRC) -name "*.go")
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
DIST=./bin $(BINARY): $(SOURCES)
SRC=./cmd go build $(BINARY_SRC)
BINARY=$(DIST)/imgcat
BINARY_SRC=$(SRC)/imgcat
SOURCE=$(shell find $(BINARY_SRC) -name "*.go")
$(BINARY): $(SOURCE)
go build -trimpath -o $(BINARY) $(BINARY_SRC)
all: $(BINARY) test all: $(BINARY) test
test: test:
$(BINARY) -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25 ./$(BINARY) -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25

View File

@ -15,13 +15,13 @@ make
Or directly Or directly
``` ```
go build -trimpath -o ./bin/imgcat ./cmd/imgcat go build ./cmd/imgcat
``` ```
## Usage ## Usage
``` ```
./bin/imgcat -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25 ./imgcat -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25
``` ```
<img width="1069" alt="Capture décran 2021-12-11 à 17 40 55" src="https://user-images.githubusercontent.com/65178/145684510-39617c22-5818-4573-896c-7e0e6915db91.png"> <img width="1069" alt="Capture décran 2021-12-11 à 17 40 55" src="https://user-images.githubusercontent.com/65178/145684510-39617c22-5818-4573-896c-7e0e6915db91.png">

2
go.mod
View File

@ -1,3 +1,3 @@
module gitlab.celogeek.com/imgcat module github.com/celogeek/imgcat
go 1.17 go 1.17