15 lines
391 B
Haskell
15 lines
391 B
Haskell
module Plugin (plugin) where
|
|
|
|
import Control.Monad (when)
|
|
import GhcPlugins
|
|
import System.Process (readProcess)
|
|
|
|
plugin :: Plugin
|
|
plugin = defaultPlugin { installCoreToDos = install }
|
|
|
|
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
|
|
install [arg] todo = do
|
|
when ('$' `elem` arg) $
|
|
fail "Make variable not expanded."
|
|
_ <- liftIO $ readProcess arg [] ""
|
|
return todo
|