commit 6119057

chld  ·  2026-02-07 02:21:27 +0000 UTC
parent d9de17b
ok maybe use a string
1 files changed,  +3, -4
+3, -4
 1@@ -7,11 +7,10 @@ import (
 2 	"path/filepath"
 3 )
 4 
 5-func Inst(pkgs []string) {
 6-	var i int
 7+func Inst(pkg string) {
 8 
 9 	in, out := os.Stdin, os.Stdout
10-	pkginst := filepath.Join("/var/tmp/dtr", "pkg-"+pkgs[i]+"-git", "*") // hard code git for now
11+	pkginst := filepath.Join("/var/tmp/dtr", "pkg-"+pkg+"-git", "*") // hard code git for now
12 	pk, err := filepath.Glob(pkginst)
13 
14 	if err != nil || len(pk) == 0 {
15@@ -29,6 +28,6 @@ func Inst(pkgs []string) {
16 	if err := cmd.Run(); err != nil {
17 		dgr.Die("failed to copy package files to root", os.Getenv("DTR_ROOT"), 1)
18 	} else {
19-		dgr.Msg("installing", pkgs[i])
20+		dgr.Msg("installing", pkg)
21 	}
22 }