Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
cache.ts1.23 kB
import { join } from "node:path" import { dotGenaiscriptPath } from "../../core/src/workdir" import { emptyDir } from "fs-extra" import { sanitizeFilename } from "../../core/src/sanitize" /** * This module provides a function to clear a specified cache directory. */ /** * Asynchronously clears the specified cache directory. * * This function removes all contents within the cache directory. If the 'name' * parameter is 'tests', it specifically targets and clears a subdirectory named 'tests' * within the cache directory. * * @param name - The name of the subdirectory to clear. * If 'tests', it targets a specific subdirectory within the cache. */ export async function cacheClear(name: string) { // Get the base cache directory path using the dotGenaiscriptPath utility function. let dir = dotGenaiscriptPath("cache") // If the name is 'tests', adjust the directory path to include the 'tests' subdirectory. if (["tests"].includes(name)) dir = join(dir, sanitizeFilename(name)) // Log the directory being cleared to the console for debugging purposes. console.log(`removing ${dir}`) // Clear the contents of the directory asynchronously. await emptyDir(dir) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsoft/genaiscript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server