GoLSh/cmd/pyapath.go
2025-06-27 15:57:36 -05:00

27 lines
429 B
Go

package cmd
import (
"gosh/types"
"gosh/utils"
"path/filepath"
"github.com/fatih/color"
)
func GolshPyapath(sh *types.Shell, path string) types.CmdOutput {
path = utils.ExpandHome(path)
abs, err := filepath.Abs(path)
red := color.New(color.FgRed).SprintFunc()
if err != nil {
return types.CmdOutput{Id: 1, Output: red(err)}
}
sh.PyPaths = append(sh.PyPaths, abs)
return types.CmdOutput{Id: 0, Output: ""}
}