mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 16:38:22 +03:00
Removed unnecessary async statements
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - These methods are completely sync, there's no need to complicate it with artificial "async" method signatures. Even if used in then chains or with await these methods should still work!
This commit is contained in:
parent
dd042d69c9
commit
2fc26bd80a
@ -32,17 +32,13 @@ const messages = {
|
||||
const filename = 'routes';
|
||||
const ext = 'yaml';
|
||||
|
||||
const getSettingsFolder = async () => {
|
||||
return config.getContentPath('settings');
|
||||
};
|
||||
|
||||
const getSettingsFilePath = async () => {
|
||||
const settingsFolder = await getSettingsFolder();
|
||||
const getSettingsFilePath = () => {
|
||||
const settingsFolder = config.getContentPath('settings');
|
||||
return path.join(settingsFolder, `${filename}.${ext}`);
|
||||
};
|
||||
|
||||
const getBackupFilePath = async () => {
|
||||
const settingsFolder = await getSettingsFolder();
|
||||
const getBackupFilePath = () => {
|
||||
const settingsFolder = config.getContentPath('settings');
|
||||
return path.join(settingsFolder, `${filename}-${moment().format('YYYY-MM-DD-HH-mm-ss')}.${ext}`);
|
||||
};
|
||||
|
||||
@ -76,8 +72,8 @@ const readFile = (settingsFilePath) => {
|
||||
};
|
||||
|
||||
const setFromFilePath = async (filePath) => {
|
||||
const settingsPath = await getSettingsFilePath();
|
||||
const backupPath = await getBackupFilePath();
|
||||
const settingsPath = getSettingsFilePath();
|
||||
const backupPath = getBackupFilePath();
|
||||
|
||||
await createBackupFile(settingsPath, backupPath);
|
||||
await saveFile(filePath, settingsPath);
|
||||
|
Loading…
Reference in New Issue
Block a user