Can anyone help me with an apple script to write an ant command?
Ant Command is: ant init clean compile run
do shell script "ant init clean compile run"
Applescript Reference: do shell script
Related
I am trying to run sdkman on a shell script that I call run.sh. This is what the inside of the shell script looks like:
sdk use java 8.0.302-open
When I run the command in a terminal, it works. But when I run it in a shell script, I get this error:
run.sh: 1: sdk: not found
Anyone knows how to fix this?
I fixed it for me; Although this may not work for others.
I placed #!/bin/bash at the top of the shell script, and then added this after it:
source "$HOME/.sdkman/bin/sdkman-init.sh"
Then my shell script was able to be ran using:
./run.sh
sdkman was able to work this time.
I want to call the make command from a bash script in a MinGW bash shell. However the script seems to know "make" only when I call the script using source:
build.sh:
#!/bin/bash
make all
Calling
source build.sh
from the terminal works: The target all is built.
Calling only
build.sh
from the terminal results in
./build.sh: line 2: make: command not found
Why do I have to source the script to have a working make command?
I already have a shell script that can uninstall and install an app from brew in bash, but I kinda want to make it a little easier to run. Basically, what I'm trying to do is create a jarfile that can run the shell script that contains my commands. Is there a way to do this (easily package a shell script in a jarfile)? Thanks for the help!
I have a Windows slave, with bash installed. I'm trying to run a shell script on it as a pre-build step. Any ideas on how I can do this?
You need to run bash with the script as an argument:
bash yourscript <arguments to your script here>
You may also need to supply the complete path to bash depending on your environment.
If your bash on Windows is part of a Cygwin install, the cygpath plugin will allow you to use 'Execute Shell' and do #!/bin/bash at the top of it, just like you would do for unix slaves.
When I run sbt interactively from a DOS shell or from a cygwin bash terminal, it functions just fine. However, when I try to run from my preferred mintty terminal, sbt doesn't respond to my commands until I send it an end of file (control-) and sbt exits.
TERM is set to cygwin when I'm using the bash terminal, and it's xterm when I'm using mintty.
Does anyone know how to fix this?
It ends up that by doing the opposite of this answer, I added the -Djline.terminal=jline.UnixTerminal java option to my sbt startup script to fix the problem.