summaryrefslogtreecommitdiff
path: root/cli/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lib.rs')
-rw-r--r--cli/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/lib.rs b/cli/lib.rs
index 5e416c6ac..4f5319508 100644
--- a/cli/lib.rs
+++ b/cli/lib.rs
@@ -17,6 +17,7 @@ extern crate serde;
extern crate serde_derive;
extern crate url;
+mod checksum;
pub mod colors;
pub mod compilers;
pub mod deno_dir;
@@ -32,6 +33,7 @@ mod http_body;
mod http_util;
mod import_map;
mod js;
+mod lockfile;
pub mod msg;
pub mod ops;
pub mod permissions;
@@ -363,6 +365,18 @@ fn run_script(flags: DenoFlags, argv: Vec<String>) {
worker
.execute_mod_async(&main_module, None, false)
.and_then(move |()| {
+ if state.flags.lock_write {
+ if let Some(ref lockfile) = 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(())
+ })
+ .and_then(move |()| {
js_check(worker.execute("window.dispatchEvent(new Event('load'))"));
worker.then(move |result| {
js_check(result);