File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
core/prompts/instructions Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import * as path from "path"
22import * as vscode from "vscode"
33
44import { GlobalFileNames } from "../../../shared/globalFileNames"
5+ import { getSettingsDirectoryPath } from "../../../utils/storage"
56
67export async function createModeInstructions ( context : vscode . ExtensionContext | undefined ) : Promise < string > {
78 if ( ! context ) throw new Error ( "Missing VSCode Extension Context" )
89
9- const settingsDir = path . join ( context . globalStorageUri . fsPath , "settings" )
10+ // Use getSettingsDirectoryPath to honor custom storage path setting
11+ const settingsDir = await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
1012 const customModesPath = path . join ( settingsDir , GlobalFileNames . customModes )
1113
1214 return `
Original file line number Diff line number Diff line change 1- import { mkdir } from "fs/promises"
2- import { join } from "path"
31import { ExtensionContext } from "vscode"
2+ import { getSettingsDirectoryPath } from "./storage"
43
54export async function getGlobalFsPath ( context : ExtensionContext ) : Promise < string > {
65 return context . globalStorageUri . fsPath
76}
87
98export async function ensureSettingsDirectoryExists ( context : ExtensionContext ) : Promise < string > {
10- const settingsDir = join ( context . globalStorageUri . fsPath , "settings" )
11- await mkdir ( settingsDir , { recursive : true } )
9+ // Use getSettingsDirectoryPath to honor custom storage path setting
10+ const settingsDir = await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
11+ // getSettingsDirectoryPath already creates the directory, so no need to call mkdir
1212 return settingsDir
1313}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as path from "path"
33import * as fs from "fs/promises"
44import { fileExistsAtPath } from "./fs"
55import { GlobalFileNames } from "../shared/globalFileNames"
6+ import { getSettingsDirectoryPath } from "./storage"
67import * as yaml from "yaml"
78
89const deprecatedCustomModesJSONFilename = "custom_modes.json"
@@ -26,7 +27,8 @@ export async function migrateSettings(
2627 ]
2728
2829 try {
29- const settingsDir = path . join ( context . globalStorageUri . fsPath , "settings" )
30+ // Use getSettingsDirectoryPath to honor custom storage path setting
31+ const settingsDir = await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
3032
3133 // Check if settings directory exists first
3234 if ( ! ( await fileExistsAtPath ( settingsDir ) ) ) {
You can’t perform that action at this time.
0 commit comments