diff --git a/src/electron/electron/updater.cljs b/src/electron/electron/updater.cljs index bc165ee2e..ec404a5b4 100644 --- a/src/electron/electron/updater.cljs +++ b/src/electron/electron/updater.cljs @@ -56,6 +56,11 @@ (emit "checking-for-update" nil) (-> (p/let [artifact (get-latest-artifact-info repo) + + artifact (when-let [remote-version (and artifact (re-find #"\d+\.\d+\.\d+" (:url artifact)))] + (if (and (. semver valid remote-version) + (. semver lt electron-version remote-version)) artifact)) + url (if-not artifact (do (emit "update-not-available" nil) (throw nil)) (:url artifact)) _ (if url (emit "update-available" (bean/->js artifact)) (throw (js/Error. "download url not exists"))) ;; start download FIXME: user's preference about auto download @@ -108,7 +113,7 @@ [repo] (when (.valid semver electron-version) (p/let [info (get-latest-artifact-info repo)] - (when-let [remote-version (and info (re-find #"\d+.\d+.\d+" (:url info)))] + (when-let [remote-version (and info (re-find #"\d+\.\d+\.\d+" (:url info)))] (if (and (. semver valid remote-version) (. semver lt electron-version remote-version))