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: use fileURLToPath for mimicked __dirname #563

Merged
merged 3 commits into from
Jul 8, 2023
Merged

fix: use fileURLToPath for mimicked __dirname #563

merged 3 commits into from
Jul 8, 2023

Conversation

risu729
Copy link
Contributor

@risu729 risu729 commented Jul 7, 2023

Fix the __dirname mimic to remove a leading slash in it by using fileURLToPath instead.

Closes #562.

Ref: https://humanwhocodes.com/snippets/2023/01/mimicking-dirname-filename-nodejs-esm/

I checked through the repo and replaced all __dirname.

Fix the __dirname mimic to remove a leading slash in it by using fileURLToPath
instead.

Closes #562.
@azu azu added the Type: Bug Bug or Bug fixes label Jul 7, 2023
@azu
Copy link
Member

azu commented Jul 7, 2023

Thanks.

Huh? I wonder why Windows CI has been going through until now.

@azu
Copy link
Member

azu commented Jul 7, 2023

const defaultSecretlintRc = new URL("../config/.secretlintrc.json", import.meta.url).pathname;

@secretlint/quick-start also need to be updated?

@risu729
Copy link
Contributor Author

risu729 commented Jul 8, 2023

I missed that part, sorry. I fixed it, so it should work now.

Co-authored-by: azu <azu@users.noreply.github.com>
@azu azu merged commit 82fcb4d into secretlint:master Jul 8, 2023
9 checks passed
@azu
Copy link
Member

azu commented Jul 8, 2023

Thanks!

@github-actions github-actions bot mentioned this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails with Error: ENOENT: no such file or directory on Windows
2 participants