Skip to content

Commit 2d13789

Browse files
committed
Some code make-up
1 parent 715cb0b commit 2d13789

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

main.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,19 @@ func main() {
147147
ConfigDir: configDir,
148148
}
149149

150-
path, err := os.Executable()
151-
if err != nil {
152-
panic(err)
153-
}
154-
155150
// 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 {
160156
log.Println("Copy error: ", err)
161157
panic(err)
162158
}
163-
164159
Systray.Update(newPath)
165160
} else {
166161
// 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 {
169163
panic(err)
170164
}
171165
Systray.Start()

0 commit comments

Comments
 (0)