forked from toolshed/abra
.gitea
cli
cmd
pkg
app
catalogue
client
compose
config
dns
git
recipe
secret
server
server.go
upstream
web
scripts
tests
.drone.yml
.envrc.sample
.gitignore
.goreleaser.yml
Makefile
README.md
go.mod
go.sum
25 lines
459 B
Go
25 lines
459 B
Go
package server
|
|
|
|
import (
|
|
"os"
|
|
"path"
|
|
|
|
"coopcloud.tech/abra/pkg/config"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// CreateServerDir creates a server directory under ~/.abra.
|
|
func CreateServerDir(serverName string) error {
|
|
serverPath := path.Join(config.ABRA_DIR, "servers", serverName)
|
|
|
|
if err := os.Mkdir(serverPath, 0755); err != nil {
|
|
if !os.IsExist(err) {
|
|
return err
|
|
}
|
|
|
|
logrus.Infof("'%s' already exists, moving on...", serverPath)
|
|
}
|
|
|
|
return nil
|
|
}
|