From 092ea9c4aee08733d1d4a20c53d1a7688910fdc3 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Sat, 11 Jan 2025 14:49:53 +0530 Subject: [PATCH] ci: fixes build command --- README.md | 29 ++++++++++++----------------- Taskfile.yml | 4 ++-- pkg/watcher/watcher.go | 1 - 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d725f98..31c3611 100644 --- a/README.md +++ b/README.md @@ -27,27 +27,22 @@ curl -L0 https://github.com/nxtcoder17/fwatcher/releases/latest/download/fwatche ```console NAME: - fwatcher - watches files in directories and operates on their changes + fwatcher-dev - simple tool to run commands on filesystem change events USAGE: - fwatcher [global options] command [command options] [arguments...] - -VERSION: - dev - -COMMANDS: - help, h Shows a list of commands or help for one command + fwatcher-dev [global options] GLOBAL OPTIONS: - --debug toggles showing debug logs (default: false) - --command value, -c value specifies command to execute on file change - --dir value, -d value directory to watch on (default: "/var/home/nxtcoder17/workspace/nxtcoder17/fwatcher") - --ignore-suffixes value, -i value [ --ignore-suffixes value, -i value ] files suffixes to ignore - --only-watch-suffixes value, -w value [ --only-watch-suffixes value, -w value ] files suffixes to watch - --exclude-dir value, -x value, -e value [ --exclude-dir value, -x value, -e value ] directory to exclude from watching - --no-default-ignore, -I disables ignoring from default ignore list (default: false) - --help, -h show help - --version, -v print the version + --debug (default: false) + --command value, -c value [command to run] (default: "echo hi") + --watch value, -w value [ --watch value, -w value ] [dir] (to watch) | -[dir] (to ignore) (default: ".") + --ext value, -e value [ --ext value, -e value ] [ext] (to watch) | -[ext] (to ignore) + --ignore-list value, -I value [ --ignore-list value, -I value ] disables ignoring from default ignore list (default: ".git", ".svn", ".hg", ".idea", ".vscode", ".direnv", "node_modules", ".DS_Store", ".log") + --cooldown value cooldown duration (default: "100ms") + --interactive interactive mode, with stdin (default: false) + --sse run watcher in sse mode (default: false) + --sse-addr value run watcher in sse mode (default: ":12345") + --help, -h show help ``` [See fwatcher in action](fwatcher_recording) diff --git a/Taskfile.yml b/Taskfile.yml index b14bc51..3f73889 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,7 +6,7 @@ vars: tasks: dev: cmds: - - go run . + - go run ./cmd build: requires: @@ -24,7 +24,7 @@ tasks: cmds: - echo "building binary for ${GOOS:-$(go env GOOS)} (${GOARCH:-$(go env GOARCH)})" - echo version str "{{.version_str}}" - - go build -ldflags '-s -w -X "main.Version={{.version_str}}"' -o ./bin/{{.binary}} + - go build -ldflags '-s -w -X "main.Version={{.version_str}}"' -o ./bin/{{.binary}} ./cmd - |+ if [[ "{{.upx}}" = "true" ]]; then upx ./bin/{{.binary}} diff --git a/pkg/watcher/watcher.go b/pkg/watcher/watcher.go index 59c4e1c..7ddce22 100644 --- a/pkg/watcher/watcher.go +++ b/pkg/watcher/watcher.go @@ -146,7 +146,6 @@ func (f *fsnWatcher) Watch(ctx context.Context) { f.Logger.Debug(fmt.Sprintf("too many events under %s, ignoring...", f.cooldownDuration.String()), "event.name", event.Name) continue } - // abs, _ := filepath.Abs(event.Name) f.eventsCh <- Event(event)