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

[1.20.4] [All] Exception when removing duplicates modules on windows #25

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Edouard127
Copy link

@Edouard127 Edouard127 commented Aug 24, 2024

This pull request replaces the system file separator by the unix file separator /
The culprit is Paths.get(path) at https://github.com/architectury/architectury-transformer/pull/25/files#diff-2ffc22c302a4c43a8045165c38bb130d608b62de4398f8b53db8a177b4987434R248 which converts the sanitized path back to a system path. The fix is really just to convert it back to unix paths

Closes #24

@CLAassistant
Copy link

CLAassistant commented Aug 24, 2024

CLA assistant check
All committers have signed the CLA.

@Edouard127
Copy link
Author

Also my ide automatically formatted files I worked in
I don't know how to disable it for certain projects only

@Edouard127
Copy link
Author

@shedaniel ready for review

Tested locally on windows 10

@shedaniel
Copy link
Member

Can you try to revert unrelated changes?

@Edouard127
Copy link
Author

I can try yes

@Edouard127 Edouard127 changed the title [1.20.4] [Forge] Exception when removing duplicates modules on windows [1.20.4] [All] Exception when removing duplicates modules on windows Aug 29, 2024
@Edouard127
Copy link
Author

@shedaniel Is there a follow-up to this pull request ?

@shedaniel shedaniel self-assigned this Sep 7, 2024
@shedaniel
Copy link
Member

My windows desktop is not setup for development so this will take some time to test, I hope I have time to do it tomorrow

@zbx1425
Copy link

zbx1425 commented Sep 18, 2024

This exception can also be caused by poorly-structured projects that has classes outside any package.
Seems that at least one author thinks putting utility scripts for publishing the mod there would be a good idea.
图片

A potential fix for this would be

String sanitized = Transform.trimLeadingSlash(path.replace(File.separatorChar, '/'));
if (sanitized.contains("/")) {
    String packageName = sanitized.substring(0, sanitized.lastIndexOf('/')).replace('/', '.');
    modules.add(packageName);
}

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.

[1.20.4] [All] Exception when removing duplicates modules on windows
4 participants