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

Fix README path for build #420

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Oct 8, 2022

Without this, I get the following error:

❯ npm start  
                                                                                                                                                                                               
> [email protected] start
> npm run watch
                                                                                               

> [email protected] watch
> rollup -c -w

[!] Error: ENOENT: no such file or directory, open 'README.md'
Error: ENOENT: no such file or directory, open 'README.md'
    at Object.openSync (node:fs:599:3)
    at Object.readFileSync (node:fs:467:35)
    at updateReadmeOutputTable (/home/nyuszika7h/code/undiscord/rollup.config.js:179:21)
    at Object.<anonymous> (/home/nyuszika7h/code/undiscord/rollup.config.js:185:1)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Object.require.extensions.<computed> [as .js] (/home/nyuszika7h/code/undiscord/node_modules/rollup/dist/shared/loadConfigFile.js:614:20)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Function.Module._load (node:internal/modules/cjs/loader:838:12)
    at Module.require (node:internal/modules/cjs/loader:1021:19)
    at require (node:internal/modules/cjs/helpers:103:18)

@@ -95,7 +95,7 @@ function updateReadmeOutputTable() {
return (startIndex !== -1 && endIndex !== -1) ? str.slice(0, startIndex + startString.length) + substitute + str.slice(endIndex) : str;
}
const fs = require('fs');
const readme = fs.readFileSync('README.md', 'utf8');
const readme = fs.readFileSync('readme.md', 'utf8');
const outputDescription = generateOutputDescription(config);
const newReadme = replaceBetween(readme, '<!-- Output table (auto generated do not modify) -->', '<!-- END -->', `\n\n${outputDescription}\n\n`);
fs.writeFileSync('README.md', newReadme);
Copy link
Contributor

@Flo4604 Flo4604 Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not also make sense to change "README." to "readme" here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, sorry it works on my end because macos is case insensitive, so I didn't notice the mistake

@victornpb
Copy link
Owner

This rollup config was based in my https://github.com/victornpb/template-library-with-rollup template repo, but this part is actually not being used by this project, because undiscord isn't a library. I removed this entire portion of code in #455, so I'm closing this PR because this fix is no longer necessary. But Thank you anyway.

@victornpb victornpb closed this Mar 5, 2023
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 this pull request may close these issues.

3 participants