mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: respect custom storage path for global custom modes
- Update ensureSettingsDirectoryExists() to use getSettingsDirectoryPath() - This ensures custom storage path setting is honored for global modes - Update createModeInstructions() to show correct path in help text - Update migrateSettings() to use custom storage path for migrations Fixes #8122
This commit is contained in:
parent
87b45def18
commit
8348e12c50
3 changed files with 10 additions and 6 deletions
|
|
@ -2,11 +2,13 @@ import * as path from "path"
|
|||
import * as vscode from "vscode"
|
||||
|
||||
import { GlobalFileNames } from "../../../shared/globalFileNames"
|
||||
import { getSettingsDirectoryPath } from "../../../utils/storage"
|
||||
|
||||
export async function createModeInstructions(context: vscode.ExtensionContext | undefined): Promise<string> {
|
||||
if (!context) throw new Error("Missing VSCode Extension Context")
|
||||
|
||||
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
||||
// Use getSettingsDirectoryPath to honor custom storage path setting
|
||||
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
const customModesPath = path.join(settingsDir, GlobalFileNames.customModes)
|
||||
|
||||
return `
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { mkdir } from "fs/promises"
|
||||
import { join } from "path"
|
||||
import { ExtensionContext } from "vscode"
|
||||
import { getSettingsDirectoryPath } from "./storage"
|
||||
|
||||
export async function getGlobalFsPath(context: ExtensionContext): Promise<string> {
|
||||
return context.globalStorageUri.fsPath
|
||||
}
|
||||
|
||||
export async function ensureSettingsDirectoryExists(context: ExtensionContext): Promise<string> {
|
||||
const settingsDir = join(context.globalStorageUri.fsPath, "settings")
|
||||
await mkdir(settingsDir, { recursive: true })
|
||||
// Use getSettingsDirectoryPath to honor custom storage path setting
|
||||
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
// getSettingsDirectoryPath already creates the directory, so no need to call mkdir
|
||||
return settingsDir
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import * as path from "path"
|
|||
import * as fs from "fs/promises"
|
||||
import { fileExistsAtPath } from "./fs"
|
||||
import { GlobalFileNames } from "../shared/globalFileNames"
|
||||
import { getSettingsDirectoryPath } from "./storage"
|
||||
import * as yaml from "yaml"
|
||||
|
||||
const deprecatedCustomModesJSONFilename = "custom_modes.json"
|
||||
|
|
@ -26,7 +27,8 @@ export async function migrateSettings(
|
|||
]
|
||||
|
||||
try {
|
||||
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
||||
// Use getSettingsDirectoryPath to honor custom storage path setting
|
||||
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
|
||||
// Check if settings directory exists first
|
||||
if (!(await fileExistsAtPath(settingsDir))) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue