gdritter repos potrero / dbd0e9e
Update hard-coded target path Getty Ritter 5 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Collapse all Expand all
1616 import qualified Parser
1717 import qualified Types
1818
19
1920 readMap :: FilePath -> IO Types.TableMap
2021 readMap path = do
2122 cs <- Text.readFile path
2627
2728 main :: IO ()
2829 main = do
29 tablesRef <- IO.newIORef =<< readMap "tables.txt"
30 tablesRef <- IO.newIORef =<< readMap "perilous-wilds.txt"
3031 Readline.setCompletionEntryFunction $ Just $ \ rs -> do
3132 tables <- IO.readIORef tablesRef
3233 pure [ Text.unpack k
4445 tables <- IO.readIORef tablesRef
4546 Text.putStrLn "Available tables: "
4647 Text.putStrLn (" " <> Text.unwords (Map.keys tables))
47 IO.writeIORef tablesRef =<< readMap "tables.txt"
4848 Just ":r" ->
49 IO.writeIORef tablesRef =<< readMap "tables.txt"
49 IO.writeIORef tablesRef =<< readMap "perilous-wilds.txt"
5050 Just choice -> do
5151 tables <- IO.readIORef tablesRef
5252 let names = Text.unwords (Map.keys tables)