Skip to content

Commit a64be9b

Browse files
authored
Dont crash watch on error (#1241)
1 parent a3a2401 commit a64be9b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

packages/cargo-pgml-components/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cargo-pgml-components/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-pgml-components"
3-
version = "0.1.23"
3+
version = "0.1.24"
44
edition = "2021"
55
authors = ["PostgresML <team@postgresml.org>"]
66
license = "MIT"

packages/cargo-pgml-components/src/frontend/tools.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ pub fn debug() {
132132
}
133133

134134
pub fn watch() {
135+
rebuild();
136+
135137
let mut debouncer = unwrap_or_exit!(new_debouncer(
136138
Duration::from_secs(1),
137139
None,
@@ -156,9 +158,7 @@ pub fn watch() {
156158
}
157159

158160
if detected {
159-
print("changes detected, rebuilding...");
160161
rebuild();
161-
info("done");
162162
}
163163
}
164164

@@ -211,7 +211,12 @@ pub fn lint(check: bool) {
211211
}
212212

213213
fn rebuild() {
214-
unwrap_or_exit!(execute_command(
215-
Command::new("cargo").arg("pgml-components").arg("bundle")
216-
));
214+
print("changes detected, rebuilding...");
215+
match execute_command(Command::new("cargo").arg("pgml-components").arg("bundle")) {
216+
Ok(_) => info("ok"),
217+
Err(err) => {
218+
error("error");
219+
error!("{}", err);
220+
}
221+
}
217222
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy