Skip to content

Commit 4d73caa

Browse files
committed
rewatch.lock -> rescript.lock
1 parent dee21c9 commit 4d73caa

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

rewatch/src/lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use sysinfo::{PidExt, System, SystemExt};
99
* that's running, when trying to aquire a lock, it checks wether that process is still running. If
1010
* not, it rewrites the lockfile to have its own PID instead. */
1111

12-
pub static LOCKFILE: &str = "rewatch.lock";
12+
pub static LOCKFILE: &str = "rescript.lock";
1313

1414
pub enum Error {
1515
Locked(u32),

rewatch/src/watcher.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::queue::*;
1010
use futures_timer::Delay;
1111
use notify::event::ModifyKind;
1212
use notify::{Config, Error, Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
13+
use crate::lock::LOCKFILE;
1314
use std::path::{Path, PathBuf};
1415
use std::sync::Arc;
1516
use std::sync::Mutex;
@@ -109,8 +110,8 @@ async fn async_watch(
109110
}
110111

111112
for event in events {
112-
// if there is a file named rewatch.lock in the events path, we can quit the watcher
113-
if let Some(_) = event.paths.iter().find(|path| path.ends_with("rewatch.lock")) {
113+
// if there is a file named rescript.lock in the events path, we can quit the watcher
114+
if let Some(_) = event.paths.iter().find(|path| path.ends_with(LOCKFILE)) {
114115
match event.kind {
115116
EventKind::Remove(_) => {
116117
if show_progress {

rewatch/tests/lock.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717

1818
exit_watcher() {
1919
# kill watcher by removing lock file
20-
rm lib/rewatch.lock
20+
rm lib/rescript.lock
2121
}
2222

2323
rewatch_bg watch > /dev/null 2>&1 &

rewatch/tests/watch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515

1616
exit_watcher() {
1717
# kill watcher by removing lock file
18-
rm lib/rewatch.lock
18+
rm lib/rescript.lock
1919
}
2020

2121
rewatch_bg watch > /dev/null 2>&1 &

0 commit comments

Comments
 (0)