Skip to content

Commit 84fbadc

Browse files
committed
Improve PWA launcher WSL performance
1 parent 0c54c54 commit 84fbadc

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/portal/runtime/browser.cljc

+14-4
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,26 @@
7676
(defn- get-windows-user []
7777
(str/trim (:out (shell/sh "cmd.exe" "/C" "echo %USERNAME%"))))
7878

79+
(defn- windows-chrome-web-applications []
80+
(tree-seq
81+
(fn [f]
82+
(and (not (fs/is-file f))
83+
(or
84+
(str/includes? f "_crx_")
85+
(str/ends-with? f "Web Applications"))))
86+
(fn [d] (fs/list d))
87+
(fs/join
88+
"/mnt/c/Users"
89+
(get-windows-user)
90+
"AppData/Local/Google/Chrome/User Data/Default/Web Applications")))
91+
7992
(defn- get-app-id-profile-windows [app-name]
8093
(try
8194
(some
8295
(fn [file]
8396
(when (str/ends-with? file (str app-name ".lnk"))
8497
{:app-id (str/replace (fs/basename (fs/dirname file)) "_crx_" "")}))
85-
(fs/file-seq
86-
(fs/join "/mnt/c/Users"
87-
(get-windows-user)
88-
"AppData/Local/Google/Chrome/User Data/Default/Web Applications")))
98+
(windows-chrome-web-applications))
8999
(catch #?(:cljs :default :default Exception) _)))
90100

91101
(defn- get-app-id-profile

0 commit comments

Comments
 (0)