refactor(tools): bin/{subject}/{method} layout; Go serve+watch modules
Move serve/ (module) -> bin/server, tools/ -> bin/tools, replace bin/kb-watch bash with bin/watch Go package; self-executing Go shebangs bin/serve.go and bin/kb/watch.go; Docker + CI + git/import + docs repointed. Multi-stage image builds static serve+watch binaries (no Go runtime in container).
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
//usr/bin/env go run "$0" "$@"; exit
|
||||
// bin/kb/watch.go - re-index the 2dph brain when corpus files change.
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// ./bin/kb/watch.go [dir...] # dirs default /corpus
|
||||
// KB_WATCH_INTERVAL=15 ./bin/kb/watch.go
|
||||
//
|
||||
// Shebang trick: first line is a Go `//` comment; the real code lives in the
|
||||
// importable package (module path, never a relative import).
|
||||
// NOTE: never run `gofmt -w` on this file - it rewrites `//usr/bin/env` to
|
||||
// `// usr/...` and breaks the shebang.
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/eSlider/2dph/bin/watch"
|
||||
)
|
||||
|
||||
func main() {
|
||||
watch.Run(os.Args[1:])
|
||||
}
|
||||
Reference in New Issue
Block a user