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

Add support for executing scripts #69

Closed
hohwille opened this issue Oct 5, 2023 · 2 comments · Fixed by #86
Closed

Add support for executing scripts #69

hohwille opened this issue Oct 5, 2023 · 2 comments · Fixed by #86
Assignees
Labels
enhancement New feature or request

Comments

@hohwille
Copy link
Member

hohwille commented Oct 5, 2023

As a developer of IDEasy, I do not want to worry what I want to execute with ProcessContext so that like in bash, I can just run any executable command.
However, if the command is a bash script (e.g. catalina.sh for tomcat), then IMHO ProcessBuilder will not be able to run it directly.
If I am not mistaken the problem and solution is explained here:
https://www.baeldung.com/run-shell-command-in-java

We also need to implement a way how to determine if an executable is a (bash)script or not. My assumption would be:

  • Filename is *.cmd or *.bat -> run using Windows CMD (only if OS is windows)
  • Filename is *.sh or the first 2 bytes of the file content are #! -> run using Bash - on Windows we also have to find bash. If I just enter bash in a CMD shell, I get C:\Windows\System32\bash.exe that is not our Git-Bash but a very limited (and IMHO kind of buggy Bash implementation from Microsoft that is not working on my computer). So like we did in devonfw-ide, we might need to auto-detect and find where bit-bash is installed (most likely "C:\Program Files\Git\git-bash.exe" but we need a more generic way - see old bash scripts to see how it can be done). Further, we might not want to open a new Git-Bash window but run that inside our existing shell (that may be a git-bash, CMD, or PowerShell - all three standalone or inside Windows-Terminal).
@hohwille hohwille added the enhancement New feature or request label Oct 5, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Oct 5, 2023
@hohwille hohwille added this to the release:2024.01.001 milestone Oct 5, 2023
@salimbouch salimbouch self-assigned this Oct 8, 2023
@hohwille hohwille moved this from 🆕 New to 🏗 In progress in IDEasy board Oct 12, 2023
@hohwille hohwille linked a pull request Oct 16, 2023 that will close this issue
@hohwille
Copy link
Member Author

Done with PR #86

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Oct 16, 2023
hohwille pushed a commit to hohwille/IDEasy that referenced this issue Oct 24, 2023
hohwille pushed a commit to hohwille/IDEasy that referenced this issue Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants