Skip to content

Commit 1863696

Browse files
authored
Naming: rewatch -> rescript (user facing) (#7606)
* Remove outdated rewatch README file * rewatch.lock -> rescript.lock * Remove "rewatch" from wording in message texts
1 parent 5d83897 commit 1863696

File tree

7 files changed

+12
-147
lines changed

7 files changed

+12
-147
lines changed

rewatch/README.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

rewatch/src/cli.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use std::{ffi::OsString, ops::Deref};
33
use clap::{Args, Parser, Subcommand};
44
use clap_verbosity_flag::InfoLevel;
55

6-
/// Rewatch is an alternative build system for the Rescript Compiler bsb (which uses Ninja internally). It strives
7-
/// to deliver consistent and faster builds in monorepo setups with multiple packages, where the
8-
/// default build system fails to pick up changed interfaces across multiple packages.
6+
/// ReScript - Fast, Simple, Fully Typed JavaScript from the Future
97
#[derive(Parser, Debug)]
108
#[command(version)]
119
#[command(args_conflicts_with_subcommands = true)]
@@ -147,7 +145,7 @@ pub struct WatchArgs {
147145

148146
#[derive(Subcommand, Clone, Debug)]
149147
pub enum Command {
150-
/// Build using Rewatch
148+
/// Build the project
151149
Build(BuildArgs),
152150
/// Build, then start a watcher
153151
Watch(WatchArgs),

rewatch/src/lock.rs

Lines changed: 2 additions & 2 deletions
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),
@@ -21,7 +21,7 @@ pub enum Error {
2121
impl std::fmt::Display for Error {
2222
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2323
let msg = match self {
24-
Error::Locked(pid) => format!("Rewatch is already running. The process ID (PID) is {}", pid),
24+
Error::Locked(pid) => format!("A ReScript build is already running. The process ID (PID) is {}", pid),
2525
Error::ParsingLockfile(e) => format!(
2626
"Could not parse lockfile: \n {} \n (try removing it and running the command again)",
2727
e

rewatch/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn main() -> Result<()> {
128128
fn get_lock(folder: &str) -> lock::Lock {
129129
match lock::get(folder) {
130130
lock::Lock::Error(error) => {
131-
println!("Could not start Rewatch: {error}");
131+
println!("Could not start ReScript build: {error}");
132132
std::process::exit(1);
133133
}
134134
acquired_lock => acquired_lock,

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ 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 &
2424
success "Watcher Started"
2525

2626
sleep 2
2727

28-
if rewatch build | grep 'Could not start Rewatch:' &> /dev/null;
28+
if rewatch build | grep 'Could not start ReScript build:' &> /dev/null;
2929
then
3030
success "Lock is correctly set"
3131
exit_watcher
@@ -43,7 +43,7 @@ success "Watcher Started"
4343

4444
sleep 2
4545

46-
if cat tmp.txt | grep 'Could not start Rewatch:' &> /dev/null;
46+
if cat tmp.txt | grep 'Could not start ReScript build:' &> /dev/null;
4747
then
4848
error "Lock not removed correctly"
4949
exit_watcher

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)