diff --git a/.gitignore b/.gitignore index c3bd858..1104fc1 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ debug test +gossa.go gossa gossa-linux gossa-linux-arm @@ -7,6 +8,7 @@ gossa-linux-arm64 gossa-mac gossa-windows.exe +.vscode fixture/* fixture/*/* !fixture/compress diff --git a/Makefile b/Makefile index 1500c9e..c4326d4 100755 --- a/Makefile +++ b/Makefile @@ -29,9 +29,8 @@ clean: embed: echo "embedding css and js into binary" cp main.go gossa.go - perl -pe 's/some_css/`cat style.css`/ge' -i gossa.go - perl -pe 's/some_js/`cat script.js`/ge' -i gossa.go - go build gossa.go + perl -pe 's/css_will_be_here/`cat style.css`/ge' -i gossa.go + perl -pe 's/js_will_be_here/`cat script.js`/ge' -i gossa.go ci: go fmt @@ -42,8 +41,10 @@ ci: ci-watch: ls main.go script.js main_test.go | entr -rc make ci -debug-watch: - ls main.go script.js | entr -rc go run main.go fixture +watch: + ls main.go script.js | entr -rc make run run: - go run main.go fixture + make embed + go run gossa.go fixture + rm gossa.go diff --git a/main.go b/main.go index 7439e2f..c6aee2f 100755 --- a/main.go +++ b/main.go @@ -31,8 +31,8 @@ var verb = flag.Bool("verb", true, "verbosity") var skipHidden = flag.Bool("k", true, "skip hidden files") var initPath = "" -var css = `some_css` -var jsTag = `some_js` +var css = `css_will_be_here` // js will be embedded here +var jsTag = `js_will_be_here` // id. var units = [8]string{"k", "M", "G", "T", "P", "E", "Z", "Y"} type rpcCall struct { @@ -71,10 +71,20 @@ func row(name string, href string, size float64, ext string) string {
` + sizeToString(size) + `