https://github.com/drewalth/onsave
An unsophisticated tool to watch a directory and run a command when a file is saved.
https://github.com/drewalth/onsave
dx go golang
Last synced: over 1 year ago
JSON representation
An unsophisticated tool to watch a directory and run a command when a file is saved.
- Host: GitHub
- URL: https://github.com/drewalth/onsave
- Owner: drewalth
- Created: 2024-11-22T18:52:22.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-22T20:57:25.000Z (over 1 year ago)
- Last Synced: 2025-02-08T16:45:20.652Z (over 1 year ago)
- Topics: dx, go, golang
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# onsave
An unsophisticated tool to watch a directory and run a command when a file is saved.
## Usage
```
onsave
```
## Example
```
onsave ./src "npm run format"
```
This will run `npm run format` whenever a file in the `./src` directory is saved.
## Installation
```
go install onsave.go
```
Verify that the binary is in your `$PATH` by running `which onsave`.
```bash
which onsave
```
If it's not, you can add it to your `$PATH` by running `export PATH="$PATH:$(go env GOPATH)/bin"` or by
adding this to your shell config file (`.zshrc`, `.bashrc`, etc.):
```bash
export PATH="$PATH:$(go env GOPATH)/bin"
```