This repository has been archived on 2024-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
cpuwatch/justfile
2023-11-08 08:48:42 +01:00

26 lines
574 B
Makefile

[private]
default:
@just help
help:
just --list
build:
go build -ldflags='-s -w' .
watch:
#!/usr/bin/env bash
while :; do
inotifywait -q -e create,modify,delete --exclude '.git' --recursive {{ justfile_directory() }} \
| while read -r directory events filename; do
if [[ $events =~ "ISDIR" ]]; then
break
elif [[ $filename =~ \.go$ ]]; then
printf "[%s]: %s%s\n" "$events" "$directory" "$filename"
just build
fi
done
done
clean:
git clean -fxd