Skip to main content
Glama
cleanOutputDir.ts1.2 kB
import { existsSync } from 'node:fs'; import { rm } from 'node:fs/promises'; import { getAppLogger } from '@intlayer/config/client'; import type { IntlayerConfig } from '@intlayer/types'; export const cleanOutputDir = async (configuration: IntlayerConfig) => { const { dictionariesDir, unmergedDictionariesDir, dynamicDictionariesDir, remoteDictionariesDir, fetchDictionariesDir, mainDir, typesDir, configDir, cacheDir, } = configuration.content; const appLogger = getAppLogger(configuration); const directoriesToClean: string[] = [ dictionariesDir, // Merged dictionaries unmergedDictionariesDir, // Unmerged dictionaries dynamicDictionariesDir, // Dynamic dictionaries remoteDictionariesDir, // Remote dictionaries fetchDictionariesDir, // Fetch dictionaries mainDir, // Main files typesDir, // Types configDir, // Configuration cacheDir, // Cache ]; // Execute all deletions in parallel await Promise.all( directoriesToClean .filter((dir) => existsSync(dir)) .map((dir) => rm(dir, { recursive: true, force: true })) ); appLogger('Output directory cleaned', { isVerbose: true, }); };

Latest Blog Posts

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/aymericzip/intlayer'

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