remove dep on osext
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/kardianos/osext"
|
||||
"github.com/kardianos/service"
|
||||
)
|
||||
|
||||
@@ -105,7 +104,7 @@ func (p *program) Stop(s service.Service) error {
|
||||
}
|
||||
|
||||
func getConfigPath() (string, error) {
|
||||
fullexecpath, err := osext.Executable()
|
||||
fullexecpath, err := os.Executable()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
module github.com/kardianos/service
|
||||
|
||||
go 1.10
|
||||
|
||||
require golang.org/x/sys v0.0.0-20190204203706-41f3e6584952
|
||||
@@ -0,0 +1,2 @@
|
||||
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952 h1:FDfvYgoVsA7TTZSbgiqjAbfPbK47CNHdWl3h/PJtii0=
|
||||
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1,16 +0,0 @@
|
||||
//+build !go1.8
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/kardianos/osext"
|
||||
)
|
||||
|
||||
func (c *Config) execPath() (string, error) {
|
||||
if len(c.Executable) != 0 {
|
||||
return filepath.Abs(c.Executable)
|
||||
}
|
||||
return osext.Executable()
|
||||
}
|
||||
Reference in New Issue
Block a user