File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ 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+ const settingsDir = await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
1011 const customModesPath = path . join ( settingsDir , GlobalFileNames . customModes )
1112
1213 return `
Original file line number Diff line number Diff line change 1- import * as path from "path"
21import * as vscode from "vscode"
3- import { promises as fs } from "fs"
42
53import type { ModeConfig } from "@roo-code/types"
64
75import { getAllModesWithPrompts } from "../../../shared/modes"
6+ import { ensureSettingsDirectoryExists } from "../../../utils/globalContext"
87
98export async function getModesSection ( context : vscode . ExtensionContext ) : Promise < string > {
10- const settingsDir = path . join ( context . globalStorageUri . fsPath , "settings" )
11- await fs . mkdir ( settingsDir , { recursive : true } )
9+ // Make sure path gets created
10+ await ensureSettingsDirectoryExists ( context )
1211
1312 // Get all modes with their overrides from extension state
1413 const allModes = await getAllModesWithPrompts ( context )
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"
4-
5- export async function getGlobalFsPath ( context : ExtensionContext ) : Promise < string > {
6- return context . globalStorageUri . fsPath
7- }
2+ import { getSettingsDirectoryPath } from "./storage"
83
94export async function ensureSettingsDirectoryExists ( context : ExtensionContext ) : Promise < string > {
10- const settingsDir = join ( context . globalStorageUri . fsPath , "settings" )
11- await mkdir ( settingsDir , { recursive : true } )
12- return settingsDir
5+ // getSettingsDirectoryPath already handles the custom storage path setting
6+ return await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
137}
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,7 @@ export async function migrateSettings(
2627 ]
2728
2829 try {
29- const settingsDir = path . join ( context . globalStorageUri . fsPath , "settings" )
30+ const settingsDir = await getSettingsDirectoryPath ( context . globalStorageUri . fsPath )
3031
3132 // Check if settings directory exists first
3233 if ( ! ( await fileExistsAtPath ( settingsDir ) ) ) {
You can’t perform that action at this time.
0 commit comments