MCPcopy
hub / github.com/continuedev/continue / createNewGlobalRuleFile

Function createNewGlobalRuleFile

core/config/workspace/workspaceBlocks.ts:186–213  ·  view source on GitHub ↗
(
  ide: IDE,
  baseFilename?: string,
)

Source from the content-addressed store, hash-verified

184}
185
186export async function createNewGlobalRuleFile(
187 ide: IDE,
188 baseFilename?: string,
189): Promise<void> {
190 try {
191 const globalDir = localPathToUri(getContinueGlobalPath());
192
193 // Create the rules subdirectory within the global directory
194 const rulesDir = joinPathsToUri(globalDir, "rules");
195
196 const fileUri = await findAvailableFilename(
197 rulesDir,
198 "rules",
199 ide.fileExists.bind(ide),
200 undefined,
201 true, // isGlobal = true for global rules
202 baseFilename,
203 );
204
205 const fileContent = getFileContent("rules");
206
207 await ide.writeFile(fileUri, fileContent);
208
209 await ide.openFile(fileUri);
210 } catch (error) {
211 throw error;
212 }
213}

Callers 1

Calls 7

localPathToUriFunction · 0.90
getContinueGlobalPathFunction · 0.90
joinPathsToUriFunction · 0.90
findAvailableFilenameFunction · 0.85
getFileContentFunction · 0.85
writeFileMethod · 0.65
openFileMethod · 0.65

Tested by

no test coverage detected