(host: SettingsDataHost)
| 48 | } |
| 49 | |
| 50 | export function getPluginDataPath(host: SettingsDataHost): string | null { |
| 51 | const pluginDir = |
| 52 | host.manifest.dir ?? |
| 53 | (host.app.vault.configDir && host.manifest.id |
| 54 | ? `${host.app.vault.configDir}/plugins/${host.manifest.id}` |
| 55 | : undefined); |
| 56 | |
| 57 | return pluginDir ? normalizePath(`${pluginDir}/data.json`) : null; |
| 58 | } |
| 59 | |
| 60 | export async function pluginDataFileExists(host: SettingsDataHost): Promise<boolean> { |
| 61 | const dataPath = getPluginDataPath(host); |
no test coverage detected