on master help sign in
Merge pull request #104 from LeifW/make_idris_install_respect_target
5138f54Edwin Brady
src/Pkg/Package.hs+3−1
@@ -6,6 +6,7 @@ import System.Directory
6import System.Exit
6import System.Exit
7import System.IO
7import System.IO
8import System.FilePath ((</>), addTrailingPathSeparator)
8import System.FilePath ((</>), addTrailingPathSeparator)
9+import System.Environment (lookupEnv)
9
10
10import Util.System
11import Util.System
11
12
@@ -102,7 +103,8 @@ toIBCFile (NS n ns) = foldl1 (</>) (reverse (toIBCFile n : ns))
102
103
103installIBC :: String -> Name -> IO ()
104installIBC :: String -> Name -> IO ()
104installIBC p m = do let f = toIBCFile m
105installIBC p m = do let f = toIBCFile m
106+ target <- lookupEnv "TARGET"
105− d <- getDataDir
107+ d <- maybe getDataDir return target
106 let destdir = d </> p </> getDest m
108 let destdir = d </> p </> getDest m
107 putStrLn $ "Installing " ++ f ++ " to " ++ destdir
109 putStrLn $ "Installing " ++ f ++ " to " ++ destdir
108 system $ mkDirCmd ++ destdir
110 system $ mkDirCmd ++ destdir