Relative path to .atom from package


#1

What is the relative path to an file in .atom from the package settings screen (atom config file).

Also will forward slashes get converted when on Windows?


#2

You’re asking two different questions here.

The settings screen is virtual based on exported config settings in the package. It is not associated with a specific file on disk.

Relative path to .atom from package

Packages are in, for example, .atom/packages/pigments, so getting from there to .atom is ../...

Also will forward slashes get converted when on Windows?

They do. Otherwise every package would require duplicate require()s and a lot of annoying compatibility work every time you want to mess with files.


#3

I am using git to sync my .atom folder and would like to add a .scss-lint.yml to this list.
Then in my linter package (Linter SCSS Lint) there is a setting to add additional arguments i.e. -c PATH_TO_CONFIG_FILE

The settings screen is virtual based on exported config settings in the package. It is not associated with a specific file on disk.

Since I switch between a Mac and Windows is there some kind of variable I can place in here to point to the root .atom folder?


#4

Nothing that’s shared across Unix-based and MS-DOS-based systems, as far as I know. However, the SCSS Lint documentation gives us the answer:

scss-lint loads configuration in the following order of precedence:

  1. Configuration file specified via the --config flag
  2. Configuration from .scss-lint.yml in the current working directory, if it exists
  3. Configuration from .scss-lint.yml in the user’s home directory, if it exists

You don’t have to pass a specific config file path every time (and in fact, you should not) because you can place the config file in your home directory. Now, you want to sync your .atom directory, not your home directory, so you’d want to have the .scss-lint.yml file in .atom and then make a symbolic link (via Terminal on Mac and this tool on Windows). Place the target of the link in your home directory.

You don’t want to specify your global config file every time because that removes the option of you placing config files in projects. The symlink is the best way to have the file where the program expects it to be while synchronizing it and not causing trouble for you later on.

Make sure to add to your .gitignore everything but the config files. Even storage/.