This repository has been archived on 2023-11-08. You can view files and clone it, but cannot push or open issues/pull-requests.
eget/shell/nu.go

26 lines
447 B
Go
Raw Normal View History

package shell
import (
"fmt"
"strings"
"go.jolheiser.com/eget/disk"
"go.jolheiser.com/eget/meta"
)
func Nu() (string, error) {
tmpl := "let-env PATH = ($env.PATH | append '%s')\n"
m, err := meta.Read()
if err != nil {
return "", err
}
var out strings.Builder
out.WriteString("# managed by eget; DO NOT EDIT\n\n")
for name := range m.Packages {
out.WriteString(fmt.Sprintf(tmpl, disk.Path(name)))
}
return out.String(), nil
}