-
Notifications
You must be signed in to change notification settings - Fork 24
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
Comments
Done with PR #86 |
Closed
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
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 IMHOProcessBuilder
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:
*.cmd
or*.bat
-> run using Windows CMD (only if OS is windows)*.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 enterbash
in aCMD
shell, I getC:\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).The text was updated successfully, but these errors were encountered: