Giter Club home page Giter Club logo

fswatcher's Introduction

fswatcher

fawatcher is an useful cross-platform command tool which will trigger the user's specified command when the watched files and pathes change. Thanks for the awesome library written in Go fsnotify.

Requirements

Go 1.18 or newer.

Installation:

git clone https://github.com/qshuai/fswatcher.git $GOPATH/src/github.com/qshuai/fswatcher
cd GOPATH/src/github.com/qshuai/fswatcher
go mod download
# please ensure the $GOPATH/bin is in your $PATH environment
go install

Usage:

> fswatcher --help
fswatcher watches the specified files or directories, and any changing event will trigger the user's command

Usage:
  fswatcher [flags]

Examples:
fswatcher -c 'echo ***' /tmp/foo

Flags:
  -c, --command string    the command to execute when change event notified
  -h, --help              help for fswatcher
  -i, --ignore strings    comma separated list of files and paths to ignore
  -v, --interval string   the user command only executes once during an interval, 0 represents every event will trigger the execution of user's command
  -n, --notify            enable system notify while event triggered (NOT IMPLEMENT)
  -r, --recursive         watch folders recursively (default true)
      --version           version for fswatcher

Example:

fswatcher -c "git add . && git commit -m 'update' && git push origin master" .

fswatcher's People

Contributors

qshuai avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vgiscinfosec

fswatcher's Issues

fswatcher makes CPU busy on MacOS platform

  1. System information

    $system_profiler SPHardwareDataType
    Hardware:
    
        Hardware Overview:
    
          Model Name: MacBook Pro
          Model Identifier: MacBookPro14,1
          Processor Name: Dual-Core Intel Core i5
          Processor Speed: 2.3 GHz
          Number of Processors: 1
          Total Number of Cores: 2
          L2 Cache (per Core): 256 KB
          L3 Cache: 4 MB
          Hyper-Threading Technology: Enabled
          Memory: 8 GB
          Boot ROM Version: 202.0.0.0.0
          SMC Version (system): 2.43f7
          Serial Number (system): FVFYP296HV22
          Hardware UUID: 05B94C31-3C41-58BD-9587-414558CA052A
  2. Golang environment

    $go env
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN="/Users/qshuai/project/go/bin"
    GOCACHE="/Users/qshuai/Library/Caches/go-build"
    GOENV="/Users/qshuai/Library/Application Support/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/qshuai/project/go"
    GOPROXY="https://goproxy.cn"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pd/rtnglfwx7yxfg43sqtts5b1r0000gn/T/go-build020812428=/tmp/go-build -gno-record-gcc-switches -fno-common"
    
  3. fswatcher running command
    nohup fswatcher -v 1h -c cd /Users/qshuai/Documents/Markdown && git add . && git commit -m 'update' && git push origin master /Users/qshuai/Documents/Markdown &

  4. snapshot:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.