mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 09:02:50 -06:00
lib/src/api/libraryBrowser/MkLang.hs - allow multiple arguments
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
|
|
||||||
import System.Environment (getArgs)
|
import System.Environment (getArgs)
|
||||||
import Data.List.Utils (replace)
|
import Data.List.Utils (replace)
|
||||||
|
|
||||||
name = "LibraryBrowserEng.gf"
|
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
a <- getArgs
|
a <- getArgs
|
||||||
case a of
|
case a of
|
||||||
lang:_ -> do
|
[] -> print "You need to provide a language code"
|
||||||
|
langs -> mapM_ makeOne langs
|
||||||
|
|
||||||
|
name = "LibraryBrowserEng.gf"
|
||||||
|
|
||||||
|
makeOne "Eng" = putStrLn "Skipping Eng"
|
||||||
|
makeOne lang = do
|
||||||
contents <- readFile name
|
contents <- readFile name
|
||||||
let name' = replace "Eng" lang name
|
let name' = replace "Eng" lang name
|
||||||
let contents' = replace "Eng" lang contents
|
let contents' = replace "Eng" lang contents
|
||||||
writeFile name' contents'
|
writeFile name' contents'
|
||||||
putStrLn $ "Wrote " ++ name'
|
putStrLn $ "Wrote " ++ name'
|
||||||
_ -> print "You need to provide a language code"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user