fix: check that docker is installed on local add

This commit is contained in:
decentral1se 2021-10-17 23:50:28 +02:00
parent c1390f232e
commit 5be190e110
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -3,6 +3,7 @@ package server
import ( import (
"context" "context"
"errors" "errors"
"os/exec"
"os/user" "os/user"
"strings" "strings"
@ -69,6 +70,9 @@ All communication between Abra and the server will use this SSH connection.
if err := server.CreateServerDir(domainName); err != nil { if err := server.CreateServerDir(domainName); err != nil {
logrus.Fatal(err) logrus.Fatal(err)
} }
if _, err := exec.LookPath("docker"); err != nil {
return errors.New("docker command not found on $PATH, is it installed?")
}
logrus.Info("local server has been added") logrus.Info("local server has been added")
return nil return nil
} }