r11na
Escript immediately exits when used as a git pre-push hook
I’m trying to write a git pre-push hook using elixir
I want to be able to read user input when the script executes and then depending on the user input proceed with the push or abort.
The problem I’m having is when excuted as a pre-push script, the script immediately exits, not waiting for my IO.gets() command.
When the script is run manually from the cmd line, it correctly waits for user input at IO.gets() and returns the result.
Is there something i’m missing here why does it not properly wait for input when triggered as a pre-push hook?
Most Liked
NobbZ
I took a quick look at the documentation, you should receive local and remote ref data per stdin. You can not ask for user input:
Information about what is to be pushed is provided on the hook’s standard input with lines of the form:
<local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LFFor instance, if the command
git push origin master:foreignwere run the hook would receive a line like the following:refs/heads/master 67890 refs/heads/foreign 12345
r11na
Thanks, I didn’t think of just using a GUI dialog.
Are you aware of something similar to kdialog for OSX?
edit: Seems cocoadialog might be it.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








