开发者

Why is sbt quitting when using fish?

I'm trying to get sbt running using the fish shell.

#!/usr/local/bin/fish 
java -Xmx512M -jar (dirname (status -f))/sbt-launch-0.7.4.jar "$argv"

When I call sbt I get the following

[info] Building project MyProject 1.0 against Scala 2.8.1
[info]    using MyProject with sbt 0.7.4 and Scala 2.7.7
[in开发者_JAVA技巧fo] 
[info] Total session time: 1 s, completed Dec 19, 2010 4:29:46 PM
[success] Build completed successfully.

Then sbt quits. Why? Shouldn't it just wait for commands?

On a possibly related note, I'm sure I didn't used to have to do #![shell] on the first line when I was using bash. What's changed?

UPDATE: When writing the equivalent script to use bash everything works fine, sbt doesn't do a build then quit

#!/bin/bash
java -Xmx512M -jar `dirname $0`/sbt-launch-0.7.4.jar "$@"


If you don't use a shebang (#!/usr/local/bin/fish in your example), a script will run with the default shell on your system, which is likely /bin/sh.

If you run your script using #!/bin/sh or #!/bin/bash does it work the way you expect it to?

There's nothing in your script that should affect how things work differently from other shells. I don't understand how your script relates to what you're doing (mostly because I'm unfamiliar with sbt). What is the name of your script? How is it called? How are you calling sbt?


Looks like you're running the shell as a script, not a shell. Fish will just run your java command and then exit.

Take the bang out of that script and make it executable and you can just run it as

/path/to/fish /path/to/script

I believe.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜