From c70895fc5f033138f0e4e697383f3ff50281b009 Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Mon, 12 Jun 2023 21:35:43 +0200 Subject: [PATCH] Create the directories if they don't exist --- Registry/registry2mulhtml.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Registry/registry2mulhtml.hs b/Registry/registry2mulhtml.hs index 81a0d26..274d50b 100644 --- a/Registry/registry2mulhtml.hs +++ b/Registry/registry2mulhtml.hs @@ -4,6 +4,8 @@ import Registry.Utils import Registry.Grammar (registry) import Registry.Registry +import System.Directory (createDirectoryIfMissing) + infile = "./language-subtag-registry" outdir = "./registry-html" @@ -31,6 +33,8 @@ main = do input <- IO.hGetContents f let theregistry = getRegistry input foreach ["language", "script", "region", "variant", - "redundant", "grandfathered"] - (toHTMLFiles theregistry) + "redundant", "grandfathered"] + (\arg -> + createDirectoryIfMissing True (outdir ++ "/" ++ arg) >> + toHTMLFiles theregistry arg)