Enhances path handling and file resolution #5
@@ -102,8 +102,12 @@ export class TempDirectoryManager {
|
||||
*/
|
||||
public isPluginTempDir(dirPath: string): boolean {
|
||||
const pluginDir = this.getPluginDir();
|
||||
// Simple string comparison for temp directory validation
|
||||
return dirPath.startsWith(pluginDir) &&
|
||||
(dirPath.includes(PLUGIN_DIRS.TEMP_IMAGES) || dirPath.includes(PLUGIN_DIRS.TEMP_PANDOC));
|
||||
const normalizedDirPath = normalizePath(dirPath);
|
||||
|
|
||||
const normalizedPluginDir = normalizePath(pluginDir);
|
||||
const tempImagesDir = normalizePath([normalizedPluginDir, PLUGIN_DIRS.TEMP_IMAGES].join('/'));
|
||||
const tempPandocDir = normalizePath([normalizedPluginDir, PLUGIN_DIRS.TEMP_PANDOC].join('/'));
|
||||
|
||||
return normalizedDirPath.startsWith(tempImagesDir) ||
|
||||
normalizedDirPath.startsWith(tempPandocDir);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user
⚠️ Potential issue | 🔴 Critical
adapter.list/remove must use vault-relative too
Same issue during cleanup; operate with vault-relative path to list and remove files correctly.
📝 Committable suggestion
🤖 Prompt for AI Agents