File tree 1 file changed +6
-12
lines changed 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -147,25 +147,19 @@ func main() {
147
147
ConfigDir : configDir ,
148
148
}
149
149
150
- path , err := os .Executable ()
151
- if err != nil {
152
- panic (err )
153
- }
154
-
155
150
// If the executable is temporary, copy it to the full path, then restart
156
- if strings .Contains (path , "-temp" ) {
157
- newPath := updater .BinPath (path )
158
- err := copyExe (path , newPath )
159
- if err != nil {
151
+ if src , err := os .Executable (); err != nil {
152
+ panic (err )
153
+ } else if strings .Contains (src , "-temp" ) {
154
+ newPath := updater .BinPath (src )
155
+ if err := copyExe (src , newPath ); err != nil {
160
156
log .Println ("Copy error: " , err )
161
157
panic (err )
162
158
}
163
-
164
159
Systray .Update (newPath )
165
160
} else {
166
161
// Otherwise copy to a path with -temp suffix
167
- err := copyExe (path , updater .TempPath (path ))
168
- if err != nil {
162
+ if err := copyExe (src , updater .TempPath (src )); err != nil {
169
163
panic (err )
170
164
}
171
165
Systray .Start ()
You can’t perform that action at this time.
0 commit comments