From 4c1dd5c0975cee8c5937ee66c5487f761410da28 Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Mon, 15 Mar 2021 13:02:30 +0000 Subject: [PATCH 1/2] chore: automatic output name on build --- .gitignore | 1 + Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e4496221..0e438fe2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ _old rice-box.go .idea/ filebrowser +filebrowser.exe .DS_Store node_modules diff --git a/Makefile b/Makefile index b85c0f4e..306854ce 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ build-frontend: | ; $(info $(M) building frontend…) ## build-backend: Build backend .PHONY: build-backend build-backend: | ; $(info $(M) building backend…) - $Q $(GO) build -ldflags '$(LDFLAGS)' -o filebrowser + $Q $(GO) build -ldflags '$(LDFLAGS)' -o . ## test: Run all tests .PHONY: test @@ -61,7 +61,7 @@ test-frontend: | ; $(info $(M) running frontend tests…) ## test-backend: Run backend tests .PHONY: test-backend -test-backend: | $(RICE) ; $(info $(M) running backend tests…) +test-backend: | ; $(info $(M) running backend tests…) $Q $(GO) test -v ./... ## lint: Lint From bdd523190eb4f742561d58db4d1260dafd699c1f Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Mon, 15 Mar 2021 14:06:21 +0000 Subject: [PATCH 2/2] chore: frontend DirFS for development --- frontend/assets.go | 2 ++ frontend/assets_dev.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 frontend/assets_dev.go diff --git a/frontend/assets.go b/frontend/assets.go index ec55c996..3509eff6 100644 --- a/frontend/assets.go +++ b/frontend/assets.go @@ -1,3 +1,5 @@ +// +build !dev + package frontend import "embed" diff --git a/frontend/assets_dev.go b/frontend/assets_dev.go new file mode 100644 index 00000000..5c2ccf06 --- /dev/null +++ b/frontend/assets_dev.go @@ -0,0 +1,14 @@ +// +build dev + +package frontend + +import ( + "io/fs" + "os" +) + +var assets fs.FS = os.DirFS("frontend") + +func Assets() fs.FS { + return assets +}