aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-05 18:20:34 +0000
committerFuwn <[email protected]>2021-05-05 18:20:34 +0000
commitb4e826012344736403f2e4ea44c1a3ff881a939f (patch)
tree2849cbc2cab9d346ae95403e3eda177929b341d7
parentfeat(make): use cargo-make instead of gnu make (diff)
downloadwhirl-b4e826012344736403f2e4ea44c1a3ff881a939f.tar.xz
whirl-b4e826012344736403f2e4ea44c1a3ff881a939f.zip
build(make): create watchable make task
-rw-r--r--Makefile.toml7
-rw-r--r--src/subs.rs11
2 files changed, 16 insertions, 2 deletions
diff --git a/Makefile.toml b/Makefile.toml
index 1949319..61799a5 100644
--- a/Makefile.toml
+++ b/Makefile.toml
@@ -53,3 +53,10 @@ args = ["${WORLDS_PATH}"]
[tasks.runc]
dependencies = ["start_client", "run"]
+
+[tasks.runw]
+env = { "DISABLE_PROMPT" = true }
+dependencies = ["checkf"]
+command = "cargo"
+args = ["run", "--", "run"]
+watch = true
diff --git a/src/subs.rs b/src/subs.rs
index 80c11d4..df9531d 100644
--- a/src/subs.rs
+++ b/src/subs.rs
@@ -36,6 +36,13 @@ pub async fn run() -> ! {
}),
];
- std::thread::sleep(std::time::Duration::from_secs(2));
- Prompt::handle();
+ if std::env::var("DISABLE_PROMPT").unwrap_or("false".to_string()) == "true" {
+ info!("starting with prompt disabled");
+ loop {
+ std::thread::sleep(std::time::Duration::default());
+ }
+ } else {
+ std::thread::sleep(std::time::Duration::from_secs(2));
+ Prompt::handle();
+ }
}