amber
amber copied to clipboard
amber watch breaks gets
Description
Can't use amber watch if startup depends on gets
Steps to Reproduce
- Add a use of gets to the amber application, e.g: in the
.cr - Run
amber watch
Expected behavior: [What you expect to happen] The process will be blocked while waiting for the user's input
Actual behavior: [What actually happens] The application does not wait for the users input
Reproduces how often: [What percentage of the time does it reproduce?] 100%
Versions
Amber CLI (amberframework.org) - v0.31.0
Crystal 0.30.1 [5e6a1b672] (2019-08-12)
LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu
Additional Information
My application has a first startup wizard that runs, this behaviour is breaking that meaning I need to use shards build
every time I make a change while manually testing initial setup.
What file are you adding it into?
src/<MY APPLICATION NAME>.cr
, the same file that calls Amber::Server.start
gets
would break auto reload which the the purpose of watch. If you want to capture stdin run crystal src/project.cr
instead.
gets
shouldn't break autoreload though, autoreload shouldn't affect the running of the program. I'm not 100% on the architecture you've got going rn, but you should be able to put it in another thread then just kill it when you need to reload.