Flag to set a custom project path.
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"gitea.codeblob.work/pk/hoster/internals/conf"
|
||||
"gitea.codeblob.work/pk/hoster/internals/helpers"
|
||||
@ -18,8 +19,9 @@ import (
|
||||
)
|
||||
|
||||
func CmdNew(c *cli.Context) error {
|
||||
name := c.String("name")
|
||||
domain := c.String("domain")
|
||||
name := strings.TrimSpace(c.String("name"))
|
||||
domain := strings.TrimSpace(c.String("domain"))
|
||||
customProjectPath := strings.TrimSpace(c.String("project-path"))
|
||||
projectRoot := conf.App.MustString("projects.root")
|
||||
sitesAvail := conf.App.MustString("nginx.sitesAvailable")
|
||||
sitesEnabled := conf.App.MustString("nginx.sitesEnabled")
|
||||
@ -27,6 +29,10 @@ func CmdNew(c *cli.Context) error {
|
||||
|
||||
projectFolder := filepath.Join(projectRoot, name)
|
||||
|
||||
if customProjectPath == "" {
|
||||
projectFolder = customProjectPath
|
||||
}
|
||||
|
||||
existingProjects, err := helpers.FindHostConfigs(sitesAvail)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user