core/cli is now a pure library (pkg/cli). The binary moves to cmd/core/ as a separate sub-module with its own go.mod. Removed from binary: gocmd (→ lint/go-build), service (→ go-process), session (→ go-session), module (→ go-scm), plugin (→ go-scm). Removed from framework: go-crypt, workspace, daemon_cmd. Root go.mod: 1 direct forge dep (core/go). Cross-compiles CGO_ENABLED=0. Co-Authored-By: Virgil <virgil@lethean.io>
23 lines
398 B
Go
23 lines
398 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"forge.lthn.ai/core/cli/pkg/cli"
|
|
)
|
|
|
|
func addPathCommand(parent *cli.Command) {
|
|
cmd := cli.NewCommand("path", "Show the configuration file path", "", func(cmd *cli.Command, args []string) error {
|
|
cfg, err := loadConfig()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println(cfg.Path())
|
|
return nil
|
|
})
|
|
|
|
cli.WithArgs(cmd, cli.NoArgs())
|
|
|
|
parent.AddCommand(cmd)
|
|
}
|