Open Pauan opened 6 years ago
Yep. This is something I was planning on adding myself anyway. (:
Right now I'm switching gears a little to stdweb
so it will take some time until I can take a stab at this. That said, if you'd like to have this sooner than later you could probably do it yourself without much trouble. Very roughly - move most of the cmd_deploy.rs
to a separate function, run it, if the first built succeeds start a loop, instantiate a watcher from the notify
crate (see how it's done in cmd_start
; here it's simpler since it can just run on the main thread), pass it whatever project.paths_to_watch()
returns, wait for changes from the watcher, rebuild and redeploy, loop again.
@koute Thanks for the tips! I would love to implement this myself, but my harddrive recently got corrupted and I'm still recovering from that. Within a couple days I should have recovered, and then I can take a stab at that.
Right now you can use the regular cargo-watch
like this:
cargo watch -x "web build"
Right now if you use
cargo web start
it will automatically re-build if the files change, which is great!But I'm developing a Chrome Extension, so
cargo web start
doesn't work for me (because the compiled files are loaded into the browser, not displayed on an HTML page).So it would be great if I could do
cargo web build --watch
,cargo web deploy --watch
, andcargo web test --watch
When using the
--watch
option it will watch for file changes (just likecargo web start
) and will then re-runcargo web build
(orcargo web deploy
/cargo web test
) automatically.