silk.build.watch.

Running a command again each time a project's sources change, for silk dev.

The command runs as the leader of its own process group, so that stopping it also stops the program it started. While it runs, SIGTERM, SIGINT and SIGHUP are held: the next look stops the group, and restarting answers 128 plus the signal's number. It needs macOS or Linux.

Import as Watch with import silk.build.watch as Watch.

Public declarations: 2.

packageSources#

silk
pub effect fn packageSources(root: &Path) -> List<Path>
    ! FileError | OutOfMemoryError
    ? &mut Allocator

What a package's development run watches below root: its src directory and its silk.toml.

restarting#

silk
pub effect fn restarting(
    program: &Path,
    arguments: &[Bytes],
    directory: &Path,
    sources: &[Path],
  ) -> i32
    ! FileError | OutOfMemoryError
    ? &mut Allocator | &mut FileSystem

Runs program with arguments in directory, sharing the terminal and environment, and runs it again each time a file under one of sources (a directory or a file) changes, stopping the running one first. A run that ends by itself is reported, and the next change starts it again. Directories named build or node_modules, and names starting with ., are not watched. Answers 128 plus the number of the signal that stopped it, or 1 when the program cannot be started.

Category: Build.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.

View the source of this page