summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-12-09 20:24:37 -0500
committerGitHub <noreply@github.com>2021-12-09 20:24:37 -0500
commitf530189c500b9f12c4c94e88eca23eab9ae0d970 (patch)
treee830ad2fa3432d65239922079f86960a98c7500e /cli/ops
parent616ff1d482894f5742463b89fbc8496196c82a64 (diff)
fix(watch): mitigate race condition between file write by other process and watch read (#13038)
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/runtime_compiler.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs
index d79a5fe31..af99f12ca 100644
--- a/cli/ops/runtime_compiler.rs
+++ b/cli/ops/runtime_compiler.rs
@@ -166,7 +166,9 @@ async fn op_emit(
args.import_map_path
{
let import_map_specifier = resolve_url_or_path(&import_map_str)
- .context(format!("Bad URL (\"{}\") for import map.", import_map_str))?;
+ .with_context(|| {
+ format!("Bad URL (\"{}\") for import map.", import_map_str)
+ })?;
let import_map = if let Some(value) = args.import_map {
ImportMap::from_json(import_map_specifier.as_str(), &value.to_string())?
} else {