mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
Removed unnecessary parameter
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - The content path parameter was passed around without really giving much additional value - the "filePath" gives big enough picture for the error to tell about what has happened
This commit is contained in:
parent
1ac0ba07de
commit
2649f32dd2
1 changed files with 5 additions and 8 deletions
|
@ -32,10 +32,9 @@ class SettingsLoader {
|
|||
|
||||
return {
|
||||
fileName,
|
||||
contentPath,
|
||||
filePath
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Functionally same as loadSettingsSync with exception of loading
|
||||
|
@ -45,7 +44,7 @@ class SettingsLoader {
|
|||
*/
|
||||
async loadSettings() {
|
||||
const setting = 'routes';
|
||||
const {fileName, contentPath, filePath} = this.getSettingFilePath(setting);
|
||||
const {fileName, filePath} = this.getSettingFilePath(setting);
|
||||
|
||||
try {
|
||||
const file = await fs.readFile(filePath, 'utf8');
|
||||
|
@ -61,9 +60,8 @@ class SettingsLoader {
|
|||
throw new errors.GhostError({
|
||||
message: tpl(messages.settingsLoaderError, {
|
||||
setting: setting,
|
||||
path: contentPath
|
||||
path: filePath
|
||||
}),
|
||||
context: filePath,
|
||||
err: err
|
||||
});
|
||||
}
|
||||
|
@ -77,7 +75,7 @@ class SettingsLoader {
|
|||
*/
|
||||
loadSettingsSync() {
|
||||
const setting = 'routes';
|
||||
const {fileName, contentPath, filePath} = this.getSettingFilePath(setting);
|
||||
const {fileName, filePath} = this.getSettingFilePath(setting);
|
||||
|
||||
try {
|
||||
const file = fs.readFileSync(filePath, 'utf8');
|
||||
|
@ -93,9 +91,8 @@ class SettingsLoader {
|
|||
throw new errors.GhostError({
|
||||
message: tpl(messages.settingsLoaderError, {
|
||||
setting: setting,
|
||||
path: contentPath
|
||||
path: filePath
|
||||
}),
|
||||
context: filePath,
|
||||
err: err
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue