forked from toolshed/abra
cli
cmd
pkg
app
autocomplete
catalogue
client
config
container
context
dns
envfile
formatter
git
integration
limit
lint
log
recipe
secret
server
server.go
service
ssh
test
upstream
web
scripts
tests
vendor
.dockerignore
.drone.yml
.envrc.sample
.gitignore
.goreleaser.yml
AUTHORS.md
Dockerfile
LICENSE
Makefile
README.md
go.mod
go.sum
renovate.json
28 lines
507 B
Go
28 lines
507 B
Go
package server
|
|
|
|
import (
|
|
"os"
|
|
"path"
|
|
|
|
"coopcloud.tech/abra/pkg/config"
|
|
"coopcloud.tech/abra/pkg/log"
|
|
)
|
|
|
|
// 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
|
|
}
|
|
|
|
log.Debugf("%s already exists", serverPath)
|
|
return nil
|
|
}
|
|
|
|
log.Debugf("successfully created %s", serverPath)
|
|
|
|
return nil
|
|
}
|