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

Move MILL_MAIN_CLI handling before shifting arguments #57

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

sake92
Copy link
Contributor

@sake92 sake92 commented Dec 18, 2023

I had an issue with BSP import on Windows, and after some debugging I think I found the bug here.

The MILL_MAIN_CLI was parsed after the arguments were shifted so %0 became %2 (the version parameter)

I added additional improvement, %~f0 (returns absolute path),
instead of just %0, which can be quirky.
https://stackoverflow.com/questions/35685721/batch-scripting-whats-the-difference-between-0-and-f0

Before:

.\.metals\millw.bat --mill-version 0.11.5 mill.bsp.BSP/install

cat .\.bsp\mill-bsp.json
{"name":"mill-bsp","argv":["0.11.5","--bsp","--disable-ticker","--color","false","--jobs","1"],"millVersion":"0.11.5","bspVersion":"2.1.0-M7","languages":["scala","java"]}

After:

.\.metals\millw.bat --mill-version 0.11.5 mill.bsp.BSP/install

 cat .\.bsp\mill-bsp.json
{"name":"mill-bsp","argv":["C:\\projects\\sake\\squery\\.metals\\millw.bat","--bsp","--disable-ticker","--color","false","--jobs","1"],"millVersion":"0.11.5","bspVersion":"2.1.0-M7","languages":["scala","java"]}

Copy link
Owner

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you @sake92 !

@lefou lefou merged commit bfaba74 into lefou:main Dec 18, 2023
1 check passed
@lefou lefou added this to the 0.4.11 milestone Dec 18, 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.

None yet

2 participants