From cc12e86fe36a77ecb0bb836ba82e823ca26abdc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 2 Jul 2020 17:54:51 +0200 Subject: refactor: lock file (#6569) - refactor lock file creation - provide deterministic output in lock file (alphabetically sorted) - dynamic imports are checked against lock file --- cli/main.rs | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'cli/main.rs') diff --git a/cli/main.rs b/cli/main.rs index 7dcc7326a..3f5b9f734 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -140,19 +140,6 @@ fn write_to_stdout_ignore_sigpipe(bytes: &[u8]) -> Result<(), std::io::Error> { } } -fn write_lockfile(global_state: GlobalState) -> Result<(), std::io::Error> { - if global_state.flags.lock_write { - if let Some(ref lockfile) = global_state.lockfile { - let g = lockfile.lock().unwrap(); - g.write()?; - } else { - eprintln!("--lock flag must be specified when using --lock-write"); - std::process::exit(11); - } - } - Ok(()) -} - fn print_cache_info(state: &GlobalState) { println!( "{} {:?}", @@ -356,8 +343,6 @@ async fn cache_command(flags: Flags, files: Vec) -> Result<(), ErrBox> { worker.preload_module(&specifier).await.map(|_| ())?; } - write_lockfile(global_state)?; - Ok(()) } @@ -606,7 +591,6 @@ async fn run_command(flags: Flags, script: String) -> Result<(), ErrBox> { debug!("main_module {}", main_module); worker.execute_module(&main_module).await?; - write_lockfile(global_state)?; worker.execute("window.dispatchEvent(new Event('load'))")?; (&mut *worker).await?; worker.execute("window.dispatchEvent(new Event('unload'))")?; -- cgit v1.2.3