diff --git a/Makefile b/Makefile index d8d473d..3abae14 100644 --- a/Makefile +++ b/Makefile @@ -10,18 +10,22 @@ PACKAGE_RPI=hkcam-$(VERSION)_linux_armhf export GO111MODULE=on -test: +build-fs: + $(GORUN) github.com/mjibson/esc -o cmd/hkcam/fs.go -ignore ".*\.go" html static + +test: build-fs $(GOTEST) -v ./... clean: $(GOCLEAN) rm -rf $(BUILD_DIR) -run: - $(GORUN) cmd/hkcam/main.go +run: build-fs + $(GOBUILD) -o $(BUILD_DIR)/hkcam -ldflags "-X main.Version=dev -X main.Date=$$(date +%FT%TZ%z)" cmd/hkcam/main.go cmd/hkcam/fs.go + $(BUILD_DIR)/hkcam --verbose --data_dir=cmd/hkcam/db package: build tar -cvzf $(PACKAGE_RPI).tar.gz -C $(BUILD_DIR) $(PACKAGE_RPI) -build: +build: build-fs GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o $(BUILD_DIR)/$(PACKAGE_RPI)/usr/bin/hkcam -i cmd/hkcam/main.go \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 1169667..c91493a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -25,7 +25,7 @@ tasks: - golangci-lint run build-fs: cmds: - - esc -o cmd/hkcam/fs.go -ignore ".*\.go" html static + - go run github.com/mjibson/esc -o cmd/hkcam/fs.go -ignore ".*\.go" html static hkcam: cmds: - task: build-fs diff --git a/go.mod b/go.mod index 186e191..94c461c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,9 @@ require ( github.com/brutella/hap v0.0.14 github.com/go-chi/chi v1.5.4 github.com/gorilla/schema v1.2.0 + github.com/mjibson/esc v0.2.0 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 + github.com/pkg/errors v0.9.1 // indirect github.com/radovskyb/watcher v1.0.6 github.com/unrolled/render v1.4.1 ) diff --git a/go.sum b/go.sum index b33ca12..4e88b57 100644 --- a/go.sum +++ b/go.sum @@ -33,12 +33,16 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/miekg/dns v1.1.46 h1:uzwpxRtSVxtcIZmz/4Uz6/Rn7G11DvsaslXoy5LxQio= github.com/miekg/dns v1.1.46/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= +github.com/mjibson/esc v0.2.0 h1:k96hdaR9Z+nMcnDwNrOvhdBqtjyMrbVyxLpsRCdP2mA= +github.com/mjibson/esc v0.2.0/go.mod h1:9Hw9gxxfHulMF5OJKCyhYD7PzlSdhzXyaGEBRPH1OPs= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/radovskyb/watcher v1.0.6 h1:8WIQ9UxEYMZjem1OwU7dVH94DXXk9mAIE1i8eqHD+IY= diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..50cbbe2 --- /dev/null +++ b/tools.go @@ -0,0 +1,5 @@ +//go:build tools + +package hkcam + +import _ "github.com/mjibson/esc"