aboutsummaryrefslogtreecommitdiff
path: root/cmd/yeet/main.go
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-04-01 22:33:36 -0400
committerXe Iaso <me@xeiaso.net>2025-04-01 22:33:36 -0400
commitf6166a6a9668ed7424514f43d7922990b7db7352 (patch)
tree0d1ceeea15974b24ea85591d314c0503e6eac31a /cmd/yeet/main.go
parent6e622796547d01f59694687decf157a9f09dd51f (diff)
downloadx-1.13.0.tar.xz
x-1.13.0.zip
cmd/yeet: build tarball packagesv1.13.0
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/yeet/main.go')
-rw-r--r--cmd/yeet/main.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/cmd/yeet/main.go b/cmd/yeet/main.go
index 2ad7985..6eca911 100644
--- a/cmd/yeet/main.go
+++ b/cmd/yeet/main.go
@@ -10,13 +10,13 @@ import (
"os/exec"
"path/filepath"
"runtime"
- "runtime/debug"
"strings"
"al.essio.dev/pkg/shellescape"
"github.com/dop251/goja"
"within.website/x/cmd/yeet/internal/mkdeb"
"within.website/x/cmd/yeet/internal/mkrpm"
+ "within.website/x/cmd/yeet/internal/mktarball"
"within.website/x/cmd/yeet/internal/pkgmeta"
"within.website/x/internal"
"within.website/x/internal/appsluggr"
@@ -89,10 +89,6 @@ func flydeploy() {
runcmd(*flyctl, "deploy", "--now")
}
-func nixbuild(target string) {
- runcmd("nix", "build", target)
-}
-
func slugbuild(bin string, extraFiles map[string]string) string {
result := fmt.Sprintf("%s-%s.tar.gz", bin, yeet.DateTag)
appsluggr.Must(bin, result, extraFiles)
@@ -171,7 +167,6 @@ func main() {
defer func() {
if r := recover(); r != nil {
slog.Error("error in JS", "err", r)
- debug.PrintStack()
}
}()
@@ -200,6 +195,14 @@ func main() {
"push": dockerpush,
})
+ vm.Set("file", map[string]any{
+ "install": func(src, dst string) {
+ if err := mktarball.Copy(src, dst); err != nil {
+ panic(err)
+ }
+ },
+ })
+
vm.Set("fly", map[string]any{
"deploy": flydeploy,
})
@@ -239,6 +242,16 @@ func main() {
"push": slugpush,
})
+ vm.Set("tarball", map[string]any{
+ "build": func(p pkgmeta.Package) string {
+ foutpath, err := mktarball.Build(p)
+ if err != nil {
+ panic(err)
+ }
+ return foutpath
+ },
+ })
+
vm.Set("yeet", map[string]any{
"cwd": yeet.WD,
"datetag": yeet.DateTag,