This repository has been archived by the owner on Apr 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support installing multiple ghc-mod instances
- Loading branch information
Showing
3 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- | Dispatcher program to support co-installation of multiple ghc-mod | ||
-- instances (compiled against different GHC versions) without breaking the | ||
-- commandline API | ||
module Main where | ||
|
||
import System.IO | ||
import System.Exit | ||
import System.Process | ||
import System.FilePath | ||
import System.Environment | ||
import Utils | ||
|
||
import Paths_ghc_mod | ||
|
||
main :: IO () | ||
main = do | ||
args <- getArgs | ||
libexecdir <- getLibexecDir | ||
let installedExe = libexecdir </> "ghc-mod-real" | ||
mexe <- mightExist installedExe | ||
case mexe of | ||
Nothing -> do | ||
hPutStrLn stderr $ | ||
"ghc-mod: Could not find '"++installedExe++"', check your installation!" | ||
exitWith $ ExitFailure 1 | ||
|
||
Just exe -> do | ||
(_, _, _, h) <- | ||
createProcess $ proc exe args | ||
exitWith =<< waitForProcess h |