Support both global and user-specific extension installation paths
- Dynamically detect extension location using import.meta.url - Support installation in public/extensions (install for all users) - Support installation in data/default-user/extensions (install just for me) - Automatically sets correct extensionFolderPath based on detected location
This commit is contained in:
@@ -4,7 +4,14 @@ import { selected_group, getGroupMembers } from '../../../group-chats.js';
|
|||||||
import { power_user } from '../../../power-user.js';
|
import { power_user } from '../../../power-user.js';
|
||||||
|
|
||||||
const extensionName = 'third-party/rpg-companion-sillytavern';
|
const extensionName = 'third-party/rpg-companion-sillytavern';
|
||||||
const extensionFolderPath = `scripts/extensions/${extensionName}`;
|
|
||||||
|
// Dynamically determine extension path based on current location
|
||||||
|
// This supports both global (public/extensions) and user-specific (data/default-user/extensions) installations
|
||||||
|
const currentScriptPath = import.meta.url;
|
||||||
|
const isUserExtension = currentScriptPath.includes('/data/') || currentScriptPath.includes('\\data\\');
|
||||||
|
const extensionFolderPath = isUserExtension
|
||||||
|
? `data/default-user/extensions/${extensionName}`
|
||||||
|
: `scripts/extensions/${extensionName}`;
|
||||||
|
|
||||||
let extensionSettings = {
|
let extensionSettings = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user