forked from toolshed/abra
.gitea
cli
cmd
pkg
app
autocomplete
catalogue
client
compose
config
container
context
dns
formatter
git
integration
jsontable
limit
lint
recipe
secret
server
server.go
service
ssh
test
upstream
web
scripts
tests
.dockerignore
.drone.yml
.envrc.sample
.gitignore
.goreleaser.yml
AUTHORS.md
Dockerfile
LICENSE
Makefile
README.md
go.mod
go.sum
renovate.json
Less confusing logging messages, clear "is created" / "already exists" output. Move the majority of logging to debug output to not confuse the situation. Some code cleanups also in there.
28 lines
512 B
Go
28 lines
512 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, 0764); err != nil {
|
|
if !os.IsExist(err) {
|
|
return err
|
|
}
|
|
|
|
logrus.Debugf("%s already exists", serverPath)
|
|
return nil
|
|
}
|
|
|
|
logrus.Debugf("successfully created %s", serverPath)
|
|
|
|
return nil
|
|
}
|