diff --git a/HISTORY.rst b/HISTORY.rst index 631991d1..b005a2db 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,9 @@ Release History 0.7.0 (?) --------- +* Implemented new ``[platformio]`` section for Configuration File with ``home_dir`` + option (`issue #14 `_) + 0.6.0 (2014-08-09) ------------------ diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 64071051..4dcfa645 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -14,6 +14,24 @@ The sections and their allowable values are described below. .. contents:: +[platformio] +------------ + +A ``platformio`` section is used for overriding default configuration options + +Options +~~~~~~~ + +``home_dir`` +^^^^^^^^^^^^ + +A PlatformIO's home directory that is used to store platforms tools chain, +frameworks, libraries, service data and etc. + + +A default value is user's home directory: *Unix* - ``~/.platformio``, +Windows - ``%HOMEPATH%\.platformio``. + [env:NAME] ---------- diff --git a/platformio/util.py b/platformio/util.py index 8fb6363b..3db23bde 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -26,7 +26,15 @@ def get_systype(): def get_home_dir(): - return expanduser("~/.platformio") + home_dir = expanduser("~/.platformio") + try: + config = get_project_config() + if (config.has_section("platformio") and + config.has_option("platformio", "home_dir")): + return config.get("platformio", "home_dir") + except NotPlatformProject: + pass + return home_dir def get_source_dir():