From eb6bc8fbd1c409bfbc5abe7767f047f87b67a872 Mon Sep 17 00:00:00 2001 From: "tilde.town" Date: Tue, 10 Feb 2015 19:00:18 +0000 Subject: [PATCH] sigh --- scripts/userlist.hy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/userlist.hy b/scripts/userlist.hy index f057092..114e183 100644 --- a/scripts/userlist.hy +++ b/scripts/userlist.hy @@ -28,10 +28,17 @@ (defn bounded-find [path] (find path "-maxdepth" "3")) +(defn guarded-mtime [filename] + (let [[path (.rstrip filename)]] + (try + (getmtime path) + (catch [e Exception] + 0)))) + (defn modify-time [username] (->> (.format "/home/{}/public_html" username) bounded-find - (map (fn [filename] (getmtime (.rstrip filename)))) + (map guarded-mtime) list max))