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: normalize filename before comparing #20

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

tarc
Copy link
Contributor

@tarc tarc commented Nov 12, 2022

Without normalizing filename, I'm running into the following issue:

resolved:  C:/Users/XXX/AppData/Local/Temp/tmp-25492-rZoK9byEw9Kc
filename:  C:\Users\XXX\AppData\Local\Temp\tmp-25492-rZoK9byEw9Kc

As the resolved variable is guaranteed to be normalized:

protobufjs-loader/index.js

Lines 191 to 198 in e0b99a6

const normOrigin = protobuf.util.path.normalize(origin);
const normTarget = protobuf.util.path.normalize(target);
let resolved = protobuf.util.path.resolve(
normOrigin,
normTarget,
true
);

filename must also be so.

My setup is:

  • Node: v16.18.1
  • Windows 10
  • protobufjs: 7.1.2
  • protobufjs-loader: 2.0.1

@tarc tarc changed the title Normalize filename before comparing fix: normalize filename before comparing Nov 12, 2022
@kmontag
Copy link
Owner

kmontag commented Nov 23, 2022

thanks!

(note the failing checks here are unrelated, and should be fixed in master now)

@kmontag kmontag merged commit 5ea23e6 into kmontag:master Nov 23, 2022
@github-actions
Copy link

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants