platformio / platformio/platformio-core

Use XDG_CONFIG_HOME for .platformio directory

Open
#2,872 6 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
9.5k
Forks
905
Avg merge
2d 13h
Merged PRs (30d)
2

Description

Temporary solution

You can override default location of .platformio folder using core_dir configuration option.

It is also possible to override the .platformio directory with the PLATFORMIO_CORE_DIR environment variable.


Configuration

Operating system: macOS 10.14

PlatformIO Version (platformio --version): 4.0.1b3

Description of problem

The ~/.platformio directory contains important config data including the user's custom boards. It's currently one of many hidden directories in my home folder. For most Unix-based systems these directories conventionally go in $XDG_CONFIG_HOME, which is usually ~/.local/share. This makes things neater for the user.

On Windows and macOS the variables XDG_CONFIG_HOME usually aren't defined, so you can use C:\Users\x\AppData\Roaming and ~/.local/share respectively (i.e., ~/.local/share does exist on macOS but isn't usually defined as XDG_CONFIG_HOME).

Steps to Reproduce
  1. Run pio init
  2. Observe new .platformio directory in $HOME

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the directory selection used by pio init, including the core_dir configuration option and PLATFORMIO_CORE_DIR environment variable described in the issue. Done means the .platformio directory uses XDG_CONFIG_HOME where applicable and the stated macOS and Windows defaults otherwise, while existing overrides continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.