Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/regexident/swift-watch
Watches over your Swift project's source
https://github.com/regexident/swift-watch
file-watcher spm swift swift-package-manager tooling
Last synced: 3 months ago
JSON representation
Watches over your Swift project's source
- Host: GitHub
- URL: https://github.com/regexident/swift-watch
- Owner: regexident
- Created: 2017-11-26T11:24:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-06T18:32:21.000Z (10 months ago)
- Last Synced: 2024-07-28T12:08:19.395Z (3 months ago)
- Topics: file-watcher, spm, swift, swift-package-manager, tooling
- Language: Swift
- Size: 29.3 KB
- Stars: 48
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# swift-watch
Watches over your Swift project's source.
## Installation
1. Build
```terminal
git clone https://github.com/regexident/swift-watch.git
cd ./swift-watch
swift build -c release
```2. Install in `$PATH` (such as in `/usr/local/bin/`):
```terminal
install -m +x "./.build/release/swift-watch" "/usr/local/bin/"
```## Usage
1. Run `$ cd /path/to/swift/package/`
2. Run `$ swift watch -x="build"`
3. Modify some files in `$ cd /path/to/swift/package/`
4. Watch `swift-watch` do its thing## Options
```terminal
OVERVIEW: Watches over your Swift project's sourceTasks (-x & -s) are executed in the order they appear.
USAGE: swift watch [options]
OPTIONS:
-c, --clear Clear output before each execution
-d, --dry-run Do not run any commands, just print them
-q, --quiet Suppress output from swift-watch itself
-p, --postpone Postpone initial execution until the first change
-m, --monochrome Suppress coloring of output from swift-watch itself
-x, --exec= Swift command(s) to execute on changes
-s, --shell= Shell command(s) to execute on changes
-h, --help The help menu
```## Roadmap
- [x] Swift commands
- [x] Shell commands
- [x] Colorful output
- [x] Console clearing
- [x] Lazy mode
- [x] Delayed runs
- [x] Quiet mode
- [x] Dry-run mode
- [ ] Ignore patterns
- [ ] Watch patterns## Shout-out
*swift-watch* was directly inspired by Rust's [*cargo-watch*](https://github.com/passcod/cargo-watch). 🙌🏻