Is there a way to obtain the default cabal config directory, i.e. the path you would specify in ghc-pkg.exe init {path}?

I wanted it in a script to automatically remove that folder for repairing/re-installing ghc.

Thanks.

有帮助吗?

解决方案

Per @user2407038's comments, I obtained the location of the cabal config location with

cabal help | tail -n1

and removed the folder using

rm -rf `cabal help | tail -n1 | xargs dirname` 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top