Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Files are Incorrectly Handled #4

Open
Redfire75369 opened this issue Dec 31, 2021 · 0 comments · May be fixed by #5
Open

Binary Files are Incorrectly Handled #4

Redfire75369 opened this issue Dec 31, 2021 · 0 comments · May be fixed by #5

Comments

@Redfire75369
Copy link

Redfire75369 commented Dec 31, 2021

In this section of code, it is assumed that all files are UTF-8. There are many cases where such a file is not UTF-8 however, such as images. Such files should be excluded from the replacements.

next-pages/src/index.js

Lines 67 to 75 in 0bc287a

if (stat.isFile()) {
let fileContent = await fs.promises.readFile(fullpath, "utf-8")
replacements.forEach(re => {
fileContent = fileContent.replace(re.find, re.replace)
})
await fs.promises.writeFile(fullpath, fileContent)
}

reeseovine added a commit to reeseovine/next-pages that referenced this issue Mar 24, 2022
@reeseovine reeseovine linked a pull request Mar 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant