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

check if plugin is configured #145

Merged
merged 2 commits into from
Sep 17, 2023
Merged

check if plugin is configured #145

merged 2 commits into from
Sep 17, 2023

Conversation

neo773
Copy link
Contributor

@neo773 neo773 commented Sep 17, 2023

cap.mp4

/claim #144

@sonarcloud
Copy link

sonarcloud bot commented Sep 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@riderx riderx merged commit 41c2f47 into Cap-go:main Sep 17, 2023
2 checks passed
const files = fs.readdirSync(dirPath);
let found = false;

files.forEach((file) => {
Copy link

Choose a reason for hiding this comment

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

This will iterate over all files in the package. Using some will break the loop once a file with the search string was found.


const searchInFile = (filePath: string, searchString: string) => {
const content = fs.readFileSync(filePath, "utf8");
return content.includes(searchString);
Copy link

Choose a reason for hiding this comment

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

This will also find the searchString if it is in a comment (and therefore never executed). I believe a more sophisticated approach is needed here like a regex. Keep in mind that it could be a line comment (//), a multiline comment (/*) or even a jsdoc comment (/**).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comments are stripped out in the build process, the upload command uploads your dist folder not source

Copy link

Choose a reason for hiding this comment

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

Not everyone uses a build process that removes all comments. And especially in debug builds comments have a valid use case.

src/bundle/upload.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants