dot-config / dot-config.github.io

dot-config promotes use of .config folders for project level settings
https://dot-config.github.io/
MIT License
43 stars 6 forks source link

Finally! #10

Closed pawamoy closed 11 months ago

pawamoy commented 1 year ago

Ha! I've been wanting such a thing for so long! I actually laid my first stone in my archan project, something like 6 years ago:

configconfig_file = os.path.join(current_dir, '.configconfig')
default_config_dir = os.path.join(current_dir, 'config')
if os.path.isfile(configconfig_file):
    with open(configconfig_file) as f:
        config_dir = os.path.join(current_dir, f.read().strip())

This code reads a .configconfig file if it exists, and its contents points to actual configuration folder the user uses to store their config files. Explained in the README:

Archan applies the following methods to find the configuration file folder:

  1. read the contents of the file .configconfig in the current directory to get the path to the configuration directory,
  2. use config folder in the current directory if it exists,
  3. use the current directory.

The issue is that I never applied this in any other project, and never promoted/advertised the concept!

I'm so glad someone else did :smile: And yours is even simpler: just use a .config folder by default :+1: I'll support this in my Python tools :tada: (which btw already all use a config folder to store their own config files)