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

#764: Fix IDEasy for CMD by adding Git related entries into PATH #886

Merged
merged 21 commits into from
Dec 19, 2024

Conversation

alfeilex
Copy link
Member

@alfeilex alfeilex commented Dec 10, 2024

Fixes: #764

Tested using:

  • Windows 10
  • CMD, PowerShell
  • Git-Version: 2.47.1.windows.1
  • ide create <project>, ide -f intellij, ide intellij

@alfeilex alfeilex self-assigned this Dec 10, 2024
@coveralls
Copy link
Collaborator

coveralls commented Dec 10, 2024

Pull Request Test Coverage Report for Build 12411555241

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 67.478%

Totals Coverage Status
Change from base Build 12375027220: 0.0%
Covered Lines: 6656
Relevant Lines: 9523

💛 - Coveralls

@alfeilex alfeilex marked this pull request as ready for review December 10, 2024 12:05
@alfeilex alfeilex changed the title #764: Fix Git Path Variable for CMD #764: Fix IDEasy for CMD by adding Git related entires into Path Dec 10, 2024
@alfeilex alfeilex changed the title #764: Fix IDEasy for CMD by adding Git related entires into Path #764: Fix IDEasy for CMD by adding Git related entries into PATH Dec 10, 2024
@alfeilex
Copy link
Member Author

if not %ERRORLEVEL% == 0 (
echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE%
)

Is the condition right here?

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@alfeilex thanks for your PR and fixing this bug. 👍
As a quickfix your changes should already work, but we need some more robustness for it.
Please have a look at my comment.

cli/src/main/package/bin/ide.bat Outdated Show resolved Hide resolved
@hohwille
Copy link
Member

hohwille commented Dec 12, 2024

if not %ERRORLEVEL% == 0 (
echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE%
)

Is the condition right here?

Very good point. We actually want the exit code of ideasy env command but we are directly processing the output of it and invoking call set %%i in the loop. Maybe the ERRORLEVEL will be overridden by that command inside the loop.
Coding CMD is actually even 10 dimensions worse to coding bash what can already be some kind of nightmare itself.
But solving this problem in bash would be very easy and doing the same in CMD could be tricky - at least I have no clue how to do it.
I just did a simple test:

C:\Users\hohwille>ide


C:\Users\hohwille>d:

D:\>cd projects

D:\projects>cd IDEasy

D:\projects\IDEasy>ide

D:\projects\IDEasy>

So it seems this condition is never met and the message is never printed out at all.
We need to create a separate bug issue for this.

UPDATE: I created bug #894 for this problem since it is unrelated to the GIT PATH issue.

cli/src/main/package/bin/ide.bat Outdated Show resolved Hide resolved
cli/src/main/package/bin/ide.bat Outdated Show resolved Hide resolved
alfeilex and others added 2 commits December 19, 2024 12:12
Co-authored-by: Jörg Hohwiller <[email protected]>
Co-authored-by: Jörg Hohwiller <[email protected]>
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

ready for merge 👍

@hohwille hohwille merged commit bc0d144 into devonfw:main Dec 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

IDEasy not working properly in CMD
4 participants