Merge pull request #3042 from chengzhichao-xydt/codex/evolution-getwd-errors
fix: handle os.Getwd() error in evolution skills_recall and drafts
This commit is contained in:
commit
875cf4a2d4
2 changed files with 8 additions and 2 deletions
|
|
@ -67,7 +67,10 @@ type DefaultDraftGenerator struct {
|
|||
func NewDefaultDraftGenerator(workspace string) *DefaultDraftGenerator {
|
||||
builtinSkillsDir := strings.TrimSpace(os.Getenv(config.EnvBuiltinSkills))
|
||||
if builtinSkillsDir == "" {
|
||||
wd, _ := os.Getwd()
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
wd = config.GetHome()
|
||||
}
|
||||
builtinSkillsDir = filepath.Join(wd, "skills")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@ type SkillsRecaller struct {
|
|||
func NewSkillsRecaller(workspace string) *SkillsRecaller {
|
||||
builtinSkillsDir := strings.TrimSpace(os.Getenv(config.EnvBuiltinSkills))
|
||||
if builtinSkillsDir == "" {
|
||||
wd, _ := os.Getwd()
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
wd = config.GetHome()
|
||||
}
|
||||
builtinSkillsDir = filepath.Join(wd, "skills")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue