1
0
mirror of https://github.com/taigrr/go-selfupdate synced 2025-01-18 04:33:12 -08:00

Return error if failed to make directory while "BackgroundRun"

This commit is contained in:
Sushil Kumar 2016-10-25 14:05:31 -07:00
parent e7050deb55
commit 13e6463ac5

View File

@ -98,7 +98,10 @@ func (u *Updater) getExecRelativeDir(dir string) string {
// BackgroundRun starts the update check and apply cycle. // BackgroundRun starts the update check and apply cycle.
func (u *Updater) BackgroundRun() error { func (u *Updater) BackgroundRun() error {
os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777) if err := os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777); err != nil {
// fail
return err
}
if u.wantUpdate() { if u.wantUpdate() {
if err := up.CanUpdate(); err != nil { if err := up.CanUpdate(); err != nil {
// fail // fail