diff --git a/.gitignore b/.gitignore index b3d0b45..435be92 100755 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,9 @@ -debug -test -gossa.go gossa gossa-linux64 gossa-linux-arm gossa-linux-arm64 gossa-mac gossa-windows.exe -gossa_test.go .vscode test-fixture/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b56b45e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "gossa-ui"] + path = gossa-ui + url = https://github.com/pldubouilh/gossa-ui + branch = master diff --git a/Makefile b/Makefile index 2737343..a2853a1 100755 --- a/Makefile +++ b/Makefile @@ -1,33 +1,30 @@ build: - make embed + cp src/gossa.go gossa.go + make -C gossa-ui/ go vet && go fmt CGO_ENABLED=0 go build gossa.go rm gossa.go run: make build - ./gossa fixture + ./gossa test-fixture watch: ls src/** | entr -rc make run -embed: - echo "embedding css and js into binary" - cp src/main.go gossa.go - perl -pe 's/template_will_be_here/`cat src\/template.go`/ge' -i gossa.go - perl -pe 's/css_will_be_here/`cat src\/style.css`/ge' -i gossa.go - perl -pe 's/js_will_be_here/`cat src\/script.js`/ge' -i gossa.go - perl -pe 's/favicon_will_be_here/`base64 -w0 src\/favicon.png`/ge' -i gossa.go - +# ci & ci debug ci: timeout 10 make run & cp src/gossa_test.go . && sleep 5 && go test + rm gossa_test.go ci-watch: ls src/* | entr -rc make ci +# build / cleanup build-all: - make embed + cp src/gossa.go gossa.go + make -C gossa-ui/ env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build gossa.go mv gossa gossa-linux64 env GOOS=linux GOARCH=arm go build gossa.go diff --git a/gossa-ui b/gossa-ui new file mode 160000 index 0000000..79f7b52 --- /dev/null +++ b/gossa-ui @@ -0,0 +1 @@ +Subproject commit 79f7b527cb750c96a636b7809cb36ccbf8548850 diff --git a/src/favicon.png b/src/favicon.png deleted file mode 100644 index 7e17946..0000000 Binary files a/src/favicon.png and /dev/null differ diff --git a/src/main.go b/src/gossa.go similarity index 100% rename from src/main.go rename to src/gossa.go diff --git a/src/gossa_test.go b/src/gossa_test.go index 39ca7f1..760e83a 100644 --- a/src/gossa_test.go +++ b/src/gossa_test.go @@ -53,8 +53,6 @@ func postJSON(t *testing.T, url string, what string) string { return trimSpaces(string(body)) } -var mainPage = `
| compress/ | ||
| curimit@gmail.com (40%)/ | ||
| gzip/ | ||
| hols/ | ||
| show-dir$$href_encoding$$/ | ||
| subdir/ | ||
| subdir_with space/ | ||
| 中文/ | ||
13.0B | 404.html | ||
40.0B | 404.html.gz | ||
5.0B | b.txt | ||
211.0B | custom_mime_type.types |