address windows bug with incomplete args[0] paths
This commit is contained in:
parent
258623ae44
commit
693e61d7d4
|
@ -6,6 +6,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -288,6 +289,13 @@ func installServiceman(c *service.Service) ([]string, error) {
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// Note: self may be the short name, in which case
|
||||||
|
// we should just use whatever is closest in the path
|
||||||
|
// exec.LookPath will handle this correctly
|
||||||
|
self, err = exec.LookPath(self)
|
||||||
|
if nil != err {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
bin, err := ioutil.ReadFile(self)
|
bin, err := ioutil.ReadFile(self)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue