{"id":25827005,"url":"https://github.com/guangie88/rs-filewatch-trigger","last_synced_at":"2025-02-28T15:52:09.330Z","repository":{"id":57663618,"uuid":"146285730","full_name":"guangie88/rs-filewatch-trigger","owner":"guangie88","description":"FileWatch Trigger to run shell actions","archived":false,"fork":false,"pushed_at":"2018-10-01T08:58:59.000Z","size":35,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T07:25:04.912Z","etag":null,"topics":["filewatcher","rust","shell","trigger"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guangie88.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-27T11:02:45.000Z","updated_at":"2024-03-14T15:58:24.000Z","dependencies_parsed_at":"2022-09-16T19:11:39.822Z","dependency_job_id":null,"html_url":"https://github.com/guangie88/rs-filewatch-trigger","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guangie88%2Frs-filewatch-trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guangie88%2Frs-filewatch-trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guangie88%2Frs-filewatch-trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guangie88%2Frs-filewatch-trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guangie88","download_url":"https://codeload.github.com/guangie88/rs-filewatch-trigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241090240,"owners_count":19907911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filewatcher","rust","shell","trigger"],"created_at":"2025-02-28T15:52:08.759Z","updated_at":"2025-02-28T15:52:09.321Z","avatar_url":"https://github.com/guangie88.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileWatch Trigger\n\nFileWatch Trigger application in Rust. The binary is named `fwt`.\n\nThe application watches for any type of file changes in the recursively watched\ndirectory, and triggers the given action.\n\nCurrently able to perform the following action(s):\n\n- Run shell template command with path and event\n\n## How to install\n\nYou may also choose to visit\n[releases](https://github.com/guangie88/rs-filewatch-trigger/releases)\nand download the latest version of statically built binary in the zip asset.\n\nAlternatively, if you have the `cargo` command, simply run\n\n```bash\ncargo install rs-filewatch-trigger\n```\n\n## Example Command\n\nFor help:\n\n```bash\nfwt -h\n```\n\nThe following contains the help message:\n\n```bash\nUSAGE:\n    fwt [FLAGS] [OPTIONS] \u003cpath\u003e \u003cSUBCOMMAND\u003e\n\nFLAGS:\n        --force-poll    Force using polling implementation, works for any platform\n    -h, --help          Prints help information\n        --relative      Use relative path instead of absolute path for path matches\n    -V, --version       Prints version information\n    -v, --verbose       Verbose mode (-v, -vv, -vvv)\n\nOPTIONS:\n    -d, --delay \u003cdelay_ms\u003e     Delay interval in milliseconds between each file watch detection [default: 1000]\n    -e, --event \u003cevent\u003e        Event type to trigger on (0=NONE, 1=CREATED, 2=DELETED, 4=MODIFIED, 8=MOVED) [default: 1]\n    -f, --filters \u003cfilters\u003e    Glob pattern(s) for file matching (comma delimited) [default: *.*]\n\nARGS:\n    \u003cpath\u003e    Directory path to watch recursive\n\nSUBCOMMANDS:\n    cmd     FileWatch Trigger to run various actions\n    help    Prints this message or the help of the given subcommand(s)\n```\n\n### Shell template command action\n\nAssuming the current working directory is `/home/xxx`:\n\n```bash\nfwt -e 15 \\\n    -f \"*.jpg,*.png\" \\\n    -v \\\n    . \\\n    cmd --print-stdout \"echo {path}: {event}\"\n```\n\nExample output:\n\n```bash\n/home/xxx/a.jpg: CREATED\n```\n\nThe following contains the help message for this action:\n\n```bash\nUSAGE:\n    fwt cmd [FLAGS] \u003ccmd\u003e\n\nFLAGS:\n    -h, --help            Prints help information\n        --print-stderr    Prints shell stderr to main stderr\n        --print-stdout    Prints shell stdout to main stdout\n    -V, --version         Prints version information\n\nARGS:\n    \u003ccmd\u003e    Shell template command to run with string interpolation ({path}: triggered file path) ({event}: event\n             type number)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangie88%2Frs-filewatch-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguangie88%2Frs-filewatch-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangie88%2Frs-filewatch-trigger/lists"}