Files
abra/pkg/server/server.go
decentral1se 8a3be01c3e
All checks were successful
continuous-integration/drone/push Build is passing
fix: $ABRA_DIR/servers subdirs also 0700
See 38f308910a
See #580
2025-08-17 14:13:47 +02:00

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, 0700); err != nil {
if !os.IsExist(err) {
return err
}
log.Debugf("%s already exists", serverPath)
return nil
}
log.Debugf("successfully created %s", serverPath)
return nil
}