This commit is contained in:
pavel 2026-05-14 20:22:35 +02:00
commit 79b3c8d693
5 changed files with 6 additions and 30 deletions

View file

@ -2,7 +2,6 @@ package app
import (
"path/filepath"
"strings"
)
func (a *App) projectDirFor(p Project) (string, error) {
@ -10,20 +9,5 @@ func (a *App) projectDirFor(p Project) (string, error) {
if err != nil {
return "", err
}
tpl := strings.TrimSpace(a.cfg.ProjectRoot)
if tpl == "" {
tpl = "$HOME/projects/$app"
}
path := tpl
path = strings.ReplaceAll(path, "${HOME}", homeDir)
path = strings.ReplaceAll(path, "$HOME", homeDir)
path = strings.ReplaceAll(path, "${app}", p.Slug)
path = strings.ReplaceAll(path, "$app", p.Slug)
if strings.HasPrefix(path, "~/") {
path = filepath.Join(homeDir, strings.TrimPrefix(path, "~/"))
}
if !filepath.IsAbs(path) {
path = filepath.Join(homeDir, path)
}
return filepath.Clean(path), nil
return filepath.Clean(filepath.Join(homeDir, "projects", p.Slug)), nil
}