diff --git a/platformio/util.py b/platformio/util.py index a5c015f3..83c3bdf3 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -4,7 +4,7 @@ import json from os import name as os_name from os import getcwd, getenv, listdir, makedirs, utime -from os.path import dirname, expanduser, isdir, isfile, join, realpath +from os.path import abspath, dirname, expanduser, isdir, isfile, join, realpath from platform import system, uname from subprocess import PIPE, Popen @@ -53,9 +53,8 @@ def get_lib_dir(): config.has_option("platformio", "lib_dir")): lib_dir = config.get("platformio", "lib_dir") if lib_dir.startswith("~"): - return expanduser(lib_dir) - else: - return lib_dir + lib_dir = expanduser(lib_dir) + return abspath(lib_dir) except NotPlatformProject: pass return join(get_home_dir(), "lib")