File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,12 +22,21 @@ func InstallExecutable() error {
2222 return nil
2323 }
2424
25- if _ , err := os .Stat (targetPath ); os .IsNotExist (err ) {
26- if err := os .MkdirAll (filepath .Dir (targetPath ), 0755 ); err != nil {
25+ _ , err := os .Stat (targetPath )
26+ notExist := os .IsNotExist (err )
27+
28+ if err := os .MkdirAll (filepath .Dir (targetPath ), 0755 ); err != nil {
29+ if notExist {
2730 return err
31+ } else {
32+ return nil
2833 }
29- if err := copyFile (selfPath , targetPath ); err != nil {
34+ }
35+ if err := copyFile (selfPath , targetPath ); err != nil {
36+ if notExist {
3037 return err
38+ } else {
39+ return nil
3140 }
3241 }
3342
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ func main() {
7171 Name : serviceName ,
7272 DisplayName : serviceDisplayName ,
7373 Description : serviceDescription ,
74- Executable : discovery .GetServiceExecutablePath (),
7574 Arguments : []string {},
7675 }
7776
You can’t perform that action at this time.
0 commit comments