-
Notifications
You must be signed in to change notification settings - Fork 2
/
paths.go
37 lines (31 loc) · 853 Bytes
/
paths.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package pkg
import (
"log"
"os"
"os/exec"
"path/filepath"
)
//GetDockerComposePath returns the docker-compose path else prints an error and exits
func GetDockerComposePath() string {
dockerComposePath, err := exec.LookPath("docker-compose")
if err != nil {
log.Fatalln("docker-compose could not be found")
}
return dockerComposePath
}
//GetPekkaTraefikPath returns the path to the pekka traefik folder
func GetPekkaTraefikPath() string {
cwd, err := os.Getwd()
if err != nil {
FatalF("An error occurred:\n %s \n", err.Error())
}
return filepath.Join(cwd, "pekka-traefik")
}
//GetDeploymentPath returns the path to the given deployment
func GetDeploymentPath(deploymentName string) string {
cwd, err := os.Getwd()
if err != nil {
FatalF("An error occurred:\n %s \n", err.Error())
}
return filepath.Join(cwd, deploymentName)
}