Simple Hot Reload (SHR) is a simple hot reload tool that watches a specified directory for file changes and automatically restarts a specified program when changes are detected. Primarily build for quick cli java hot reload
- Watch a specified directory for file changes.
- Automatically restart a specified program when changes are detected.
- Should be able to run on any platform that supports Go. It has been tested only on Linux though.
- Go 1.23.2 or later
To build the Simple Hot Reload tool from source, follow these steps:
-
Clone the repository:
git clone https://github.com/0x6DD8/simple-hot-reload.git cd simple-hot-reload
-
Build the binary for your platform:
make build-linux # For Linux make build-windows # For Windows
-
Optionally, you can move the binary to
/usr/local/bin
on Linux:sudo make install-linux
To use the Simple Hot Reload, run the following command:
./shr <path-to-watch> <program-to-run> [args...]
./shr /path/to/project java main.java
This command will watch the /path/to/project
directory for changes and automatically restart the java main.java
command whenever a change is detected.
make all
: Build the binary for all supported platforms.make build-linux
: Build the binary for Linux.make build-windows
: Build the binary for Windows.make clean
: Clean up build artifacts.make install-linux
: Install the Linux binary to/usr/local/bin
.make uninstall-linux
: Uninstall the Linux binary from/usr/local/bin
.