rejeep / prodigy.el

Manage external services from within Emacs
GNU General Public License v3.0
550 stars 39 forks source link

Show "Done!" message for 5 seconds after one-off task is run #141

Open aguynamedben opened 1 year ago

aguynamedben commented 1 year ago

Hi, I just discovered prodigy and it's great so far.

Is there a recommended way to deal with one-off tasks? I have:

(prodigy-define-service
  :name "rustcpp - cargo run"
  :command "cargo"
  :args '("run")
  :cwd "~/code/rustcpp"
  :tags '(rust)
  :stop-signal 'sigkill
  :kill-process-buffer-on-stop t)

(prodigy-define-service
  :name "rustcpp - cargo build"
  :command "cargo"
  :args '("build")
  :cwd "~/code/rustcpp"
  :tags '(rust)
  :stop-signal 'sigkill
  :kill-process-buffer-on-stop t
  :ready-message "Finished dev")

The first command, cargo run, is a service that has a traditional "start/stop/restart" flow, but the second command, cargo build is a one-off build script that gives RC 0 and the "Finished dev" message. Is there a way to get the UI of prodigy to just say "Done!" or something? I've set :ready-message "Finished dev" but that makes the UI say "Ready".

image

It would be cool if I could provide the parameter :one-off-task 1 to the prodigy service, and after seeing RC 0 the UI of prodigy would say "Done!" for 5 seconds, then go "blank" again. Does that make sense?

Thanks for providing this great library.

rejeep commented 1 year ago

I think I had this idea in the past as well (something like :type 'batch IIRC). For example when coding Rails I might want to run or rollback migrations.

It was too long ago I worked on the code, so I couldn't tell you how complicated it would be to implement, but you are welcome to try. 🙂

aguynamedben commented 1 year ago

@rejeep Cool, I'll let you know if I get around to it... thanks for making this available in the first place. Emacs 4 lyfe :)