-
Notifications
You must be signed in to change notification settings - Fork 90
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
Feature suggestion: inline-shell #342
Comments
@georgewsinger: To make sure I understand correctly: would this translate to one call to |
Oops, I mean |
I'm not sure what is best long-term, but at first glance it seems translating to one Though on second glance: how does bash itself treat a statement like (I'm not very familiar with how shells and turtle work under the hood, so I hope I'm not spouting nonsense here). |
Maybe the simplest approach would be to save the inline shell block to a file and then interpret that file using the shell. The main reason I suggest this is that otherwise |
That sounds perfect. Every Haskell file |
The main issue I can think of is that this would require creating multiple versions of this utility that parallel One way to reduce the API proliferation might be to provide a utility for saving tempFile :: MonadManaged managed => Text -> m FilePath ... because if you had such a utility then you can combine that with the {-# LANGUAGE QuasiQuotes #-}
import Turtle (fp)
import qualified NeatInterpolation
import qualified Turtle
main :: IO ()
main = Turtle.sh $ do
script <- tempFile [NeatInterpolation.text|
# Print something to console from bash.
echo "Hello from"
|]
x <- Turtle.strict (Turtle.inshell "bash" [ Turtle.format fp script ] Turtle.empty)
… ... as a bonus, if you use the |
Suggestion: I think this library would be an order of magnitude more useful if it implemented something akin to inline-C. I.e:
This would allow someone to mix quick bash scripts with the aid of Turtle's typing system.
The text was updated successfully, but these errors were encountered: