Skip to content

Commit

Permalink
lowercase html file names
Browse files Browse the repository at this point in the history
  • Loading branch information
adase11 committed Oct 7, 2024
1 parent 3e2ddae commit bd14cf2
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@
},
"scripts": {
"dev": "next dev",
"build": "next lint --fix && next build",
"build": "next lint --fix && next build && node scripts/post-export.js",
"start": "next lint --fix && next build && next start",
"lint": "next lint --fix",
"predeploy": "next build",
"predeploy": "next build && node scripts/post-export.js",
"test": ""
},
"dependencies": {
23 changes: 23 additions & 0 deletions scripts/post-export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// scripts/post-export.js
const fs = require('fs');
const path = require('path');

const directory = path.join(__dirname, '../out');

function renameFilesToLowerCase(dir) {
fs.readdirSync(dir).forEach((file) => {
const fullPath = path.join(dir, file);
if (fs.lstatSync(fullPath).isDirectory()) {
renameFilesToLowerCase(fullPath);
} else if (file.endsWith('.html')) {
const lowerCaseFile = file.toLowerCase();
if (file !== lowerCaseFile) {
fs.renameSync(fullPath, path.join(dir, lowerCaseFile));
console.log(`Renamed ${file} to ${lowerCaseFile}`);
}
}
});
}

renameFilesToLowerCase(directory);

2 changes: 0 additions & 2 deletions src/components/Contact/ContactIcons.tsx
Original file line number Diff line number Diff line change
@@ -14,5 +14,3 @@ const ContactIcons = () => (
);

export default ContactIcons;


0 comments on commit bd14cf2

Please sign in to comment.