Unverified Commit a1a5fc7b authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #6624 from m-renaud/m-renaud-default-installdir

Use default install directory if not specified.
parents b24a4880 735467e5
......@@ -64,7 +64,7 @@ import Distribution.Simple.BuildPaths
import Distribution.Simple.Program.Find
( ProgramSearchPathEntry(..) )
import Distribution.Client.Config
( getCabalDir, loadConfig, SavedConfig(..) )
( defaultInstallPath, getCabalDir, loadConfig, SavedConfig(..) )
import qualified Distribution.Simple.PackageIndex as PI
import Distribution.Solver.Types.PackageIndex
( lookupPackageName, searchByName )
......@@ -641,6 +641,7 @@ installExes
-> IO ()
installExes verbosity baseCtx buildCtx platform compiler
configFlags clientInstallFlags = do
installPath <- defaultInstallPath
let storeDirLayout = cabalStoreDirLayout $ cabalDirLayout baseCtx
prefix = fromFlagOrDefault "" (fmap InstallDirs.fromPathTemplate (configProgPrefix configFlags))
......@@ -658,9 +659,10 @@ installExes verbosity baseCtx buildCtx platform compiler
mkFinalExeName exe = prefix <> unUnqualComponentName exe <> suffix <.> exeExtension platform
installdirUnknown =
"installdir is not defined. Set it in your cabal config file "
++ "or use --installdir=<path>"
++ "or use --installdir=<path>. Using default installdir: " ++ show installPath
installdir <- fromFlagOrDefault (die' verbosity installdirUnknown) $
installdir <- fromFlagOrDefault
(warn verbosity installdirUnknown >> pure installPath) $
pure <$> cinstInstalldir clientInstallFlags
createDirectoryIfMissingVerbose verbosity False installdir
warnIfNoExes verbosity buildCtx
......
......@@ -26,6 +26,7 @@ module Distribution.Client.Config (
defaultConfigFile,
defaultCacheDir,
defaultCompiler,
defaultInstallPath,
defaultLogsDir,
defaultUserInstall,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment