AI-scripts
AI-scripts copied to clipboard
tscoder is unable to create new directories
Within "write each file" method I was able to add one line of code to get it working :)
// Backup existing file if it exists
if (await fs.access(absolutePath).then(() => true).catch(() => false)) {
await fs.copyFile(absolutePath, backupPath);
}
// Create necessary directories for the target file
await fs.mkdir(path.dirname(absolutePath), { recursive: true });
// Write the new content
await fs.writeFile(absolutePath, fileToWrite.content, 'utf-8');
ty @Lorenzobattistela can you have a look?