aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-03-05 13:17:27 -0500
committerXe Iaso <me@xeiaso.net>2024-03-05 13:17:27 -0500
commitffaea423b670030978c4ec0c2efa72a3bc8386c1 (patch)
treeccbbc8cf02824729d72dd2006c37f69d3c5e14ff /cmd
parenta0358e26e7c267d67cb139698ef2057d3d970f57 (diff)
downloadx-ffaea423b670030978c4ec0c2efa72a3bc8386c1.tar.xz
x-ffaea423b670030978c4ec0c2efa72a3bc8386c1.zip
cmd/yeet: start protoc rigging
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/yeet/main.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/yeet/main.go b/cmd/yeet/main.go
index 71d40aa..b143597 100644
--- a/cmd/yeet/main.go
+++ b/cmd/yeet/main.go
@@ -25,6 +25,7 @@ import (
var (
fname = flag.String("fname", "yeetfile.js", "filename for the yeetfile")
flyctl = flag.String("flyctl-path", flyctlPath(), "path to flyctl binary")
+ protocPath = flag.String("protoc-path", "protoc", "path to protoc binary")
)
func flyctlPath() string {
@@ -148,10 +149,20 @@ func hostname() string {
return result
}
+type protocInput struct {
+ Input string `json:"input"`
+ Output string `json:"output"`
+ Kinds []struct {
+ Kind string `json:"kind"`
+ Opt string `json:"opt"`
+ } `json:"kinds"`
+}
+
func main() {
internal.HandleStartup()
vm := goja.New()
+ vm.SetFieldNameMapper(goja.TagFieldNameMapper("json", true))
defer func() {
if r := recover(); r != nil {
@@ -186,6 +197,12 @@ func main() {
"deploy": flydeploy,
})
+ vm.Set("git", map[string]any{
+ "repoRoot": func() string {
+ return runcmd("git", "rev-parse", "--show-toplevel")
+ },
+ })
+
vm.Set("go", map[string]any{
"build": func() { runcmd("go", "build") },
"install": func() { runcmd("go", "install") },