Skip to content

Commit

Permalink
fix a build error in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
oka4shi committed Feb 2, 2024
1 parent 17c0ff9 commit 023f1bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/utils/i18n/core/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export default function i18nPlus({ locales, POSIXlocalesMap, defaultLocale }: i1
.filter((i) => i !== defaultLocale)
.forEach((locale) => {
const locale_dir = dir.pathname + locale;
try {
const target = fs.statSync(`${locale_dir}/404`);
if (!target.isDirectory()) {
console.log(`Skip "${locale}"`);
return;
}
} catch (err) {
console.log(`Skip "${locale}"`);
return;
}
fs.rename(`${locale_dir}/404/index.html`, `${locale_dir}/404.html`, (err) => {
if (err) {
console.log("Failed to rename path of 404 files");
Expand Down

0 comments on commit 023f1bd

Please sign in to comment.