init
This commit is contained in:
20
mc_test/scripts/copy-fonts.js
Executable file
20
mc_test/scripts/copy-fonts.js
Executable file
@ -0,0 +1,20 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const sourceDir = path.join(__dirname, '..', 'fonts');
|
||||
const targetDir = path.join(__dirname, '..', 'public', 'fonts');
|
||||
|
||||
// Create target directory if it doesn't exist
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Copy all font files
|
||||
fs.readdirSync(sourceDir).forEach(file => {
|
||||
if (file.match(/\.(woff2?|eot|ttf)$/i)) {
|
||||
fs.copyFileSync(
|
||||
path.join(sourceDir, file),
|
||||
path.join(targetDir, file)
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user