lts-16.13 + maybe call those plugins with make 'srcPlugins' because it's going to be a massive PITA to develop them if I have to build them with ghc --make

This commit is contained in:
Jon Doe
2020-09-13 16:06:16 +02:00
committed by Maciej Bonin
parent 618d7f6cb4
commit aea2f79138
3 changed files with 25 additions and 17 deletions

View File

@ -6,8 +6,8 @@ import Data.Maybe
import Control.Concurrent.STM
import Control.Concurrent.STM.TMVar
pluginPath :: IO FilePath
pluginPath = getXdgDirectory XdgData "gypsfulvus/plugins" >>= makeAbsolute
srcPluginPath :: IO FilePath
srcPluginPath = getXdgDirectory XdgData "gypsfulvus/src_plugins" >>= makeAbsolute
configPath :: IO FilePath
@ -21,11 +21,11 @@ configPath = getXdgDirectory XdgConfig "gypsfulvus"
loadCommsPlugins canary collectorChannel =
let potentialPlugins = pluginPath >>= \pp -> listDirectory pp >>= filterM (\fuku -> doesDirectoryExist (pp ++ "/" ++ fuku)) >>= mapM (\fuku -> return (pp ++ "/" ++ fuku))
let potentialPlugins = srcPluginPath >>= \pp -> listDirectory pp >>= filterM (\fuku -> doesDirectoryExist (pp ++ "/" ++ fuku)) >>= mapM (\fuku -> return (pp ++ "/" ++ fuku))
in do
pluginPath >>= putStrLn
pluginPath >>= listDirectory >>= mapM putStrLn
pluginPath >>= \pp -> listDirectory pp >>= filterM (\fuku -> putStrLn (pp ++ "/" ++ fuku) >> doesDirectoryExist (pp ++ "/" ++ fuku))
srcPluginPath >>= putStrLn
srcPluginPath >>= listDirectory >>= mapM putStrLn
srcPluginPath >>= \pp -> listDirectory pp >>= filterM (\fuku -> putStrLn (pp ++ "/" ++ fuku) >> doesDirectoryExist (pp ++ "/" ++ fuku))
pp <- potentialPlugins
mapM_ putStrLn pp
ff <- mapM (\d -> findFile [d] "Plugin.hs") pp