diff --git a/frontend/apps/erd-sample/scripts/update_dist_content.mjs b/frontend/apps/erd-sample/scripts/update_dist_content.mjs index b153acb5..d1747843 100644 --- a/frontend/apps/erd-sample/scripts/update_dist_content.mjs +++ b/frontend/apps/erd-sample/scripts/update_dist_content.mjs @@ -1,43 +1,55 @@ -import fs from 'fs'; -import path from 'path'; -import { fileURLToPath } from 'url'; +import fs from 'fs' +import path from 'path' +import { fileURLToPath } from 'url' // Get the directory name of the current module -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) // Path to the target HTML file -const filePath = path.join(__dirname, '..', 'dist', 'index.html'); +const filePath = path.join(__dirname, '..', 'dist', 'index.html') // Content to insert into
const contentToInsertHead = ` - -`; + + + +` // Content to insert into const contentToInsertBody = ` - -`; + + + +` // Read the file fs.readFile(filePath, 'utf8', (err, data) => { if (err) { - console.error('Failed to read file:', err); - return; + console.error('Failed to read file:', err) + return } // Insert content immediately after the tag - let updatedData = data.replace(//, `\n ${contentToInsertHead}`); + let updatedData = data.replace(//, `\n ${contentToInsertHead}`) // Insert content immediately after the tag - updatedData = updatedData.replace(//, `\n ${contentToInsertBody}`); + updatedData = updatedData.replace( + //, + `\n ${contentToInsertBody}`, + ) // Write the updated data back to the file fs.writeFile(filePath, updatedData, 'utf8', (err) => { if (err) { - console.error('Failed to write file:', err); - return; + console.error('Failed to write file:', err) + return } - console.log('Content successfully inserted into and .'); - }); -}); + console.log('Content successfully inserted into and .') + }) +})