From 5b74921ced973b3d908376e5ccbcf47b1b5c1dd1 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 12 Dec 2021 18:27:06 +0100 Subject: [PATCH] update build --- .gitignore | 2 +- Makefile | 17 ++++++++--------- README.md | 4 ++-- go.mod | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index ba077a4..472723f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -bin +imgcat diff --git a/Makefile b/Makefile index 2b9442d..4cd400e 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,14 @@ +SRC=./cmd +BINARY=imgcat +BINARY_SRC=$(SRC)/imgcat +SOURCES=$(shell find $(BINARY_SRC) -name "*.go") + .DEFAULT_GOAL := all -DIST=./bin -SRC=./cmd -BINARY=$(DIST)/imgcat -BINARY_SRC=$(SRC)/imgcat -SOURCE=$(shell find $(BINARY_SRC) -name "*.go") - -$(BINARY): $(SOURCE) - go build -trimpath -o $(BINARY) $(BINARY_SRC) +$(BINARY): $(SOURCES) + go build $(BINARY_SRC) all: $(BINARY) 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 \ No newline at end of file + ./$(BINARY) -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25 diff --git a/README.md b/README.md index 0dd8d2e..fc9ea52 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ make Or directly ``` -go build -trimpath -o ./bin/imgcat ./cmd/imgcat +go build ./cmd/imgcat ``` ## 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 ``` Capture d’écran 2021-12-11 à 17 40 55 diff --git a/go.mod b/go.mod index 9cf9249..b9c0cc4 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module gitlab.celogeek.com/imgcat +module github.com/celogeek/imgcat go 1.17