TUN-5867: Return error if service was already installed
This commit is contained in:
parent
8cbd222e10
commit
ca43b0357f
|
@ -43,6 +43,10 @@ func (st *ServiceTemplate) Generate(args *ServiceTemplateArgs) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if _, err = os.Stat(resolvedPath); err == nil {
|
||||||
|
return fmt.Errorf("cloudflared service is already installed at %s", resolvedPath)
|
||||||
|
}
|
||||||
|
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
err = tmpl.Execute(&buffer, args)
|
err = tmpl.Execute(&buffer, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue