Ghost/ghost/settings-path-manager
Hannah Wolfe b80b90229f Added consistent linting pattern to all packages
refs: https://github.com/TryGhost/Toolbox/issues/188

- some of our older packages used a pattern for linting which missed using test config for linting tests
- we need this to be consistent so that we can add more eslint rules for testing
- two packages also didn't use the lib pattern, which made the lint pattern error - so this was fixed as well
2023-06-13 10:43:29 +01:00
..
lib Added eslint rule for file naming convention 2023-05-09 12:34:34 -04:00
test Added getBackupFilePath to settings-path-manager module 2021-09-30 20:14:21 +02:00
.eslintrc.js Added settings-path-manager module 2021-09-30 19:22:09 +02:00
index.js Added eslint rule for file naming convention 2023-05-09 12:34:34 -04:00
package.json Added consistent linting pattern to all packages 2023-06-13 10:43:29 +01:00
README.md Tidied up package README and LICENSE files 2022-07-26 15:22:10 +02:00

Settings Path Manager

A library which helps locating configuration paths in Ghost. For example configs for dynamic routes or redirects.

Usage

Example use in to create routes.yaml configuration files:

const config = require('../shared/config'); // or whatever place the storage folders are configured at

const settingsPathManager = new SettingsPathManager({
    type: 'routes',
    paths: [config.getContentPath('settings')]
});

const filePath = settingsPathManager.getDefaultFilePath();

console.log(config.getContentPath('settings')); // -> '/content/data/'
console.log(filePath); // -> '/content/data/routes.yaml'