Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ const ALWAYS_LOAD_SKILLS = ["using-superpowers"];
function getCacheDir(): string {
// Plugin directory is where this file is located
const pluginDir = path.dirname(new URL(import.meta.url).pathname);
return path.join(pluginDir, CACHE_DIR_NAME);

// On Windows, pathname from URL starts with /C:/ or similar
// We need to remove the leading slash for proper path joining
const normalizedPluginDir = process.platform === 'win32' && pluginDir.startsWith('/')
? pluginDir.substring(1).replace(/\//g, '\\')
: pluginDir;

return path.join(normalizedPluginDir, CACHE_DIR_NAME);
}

/**
Expand Down