{"id":13496564,"url":"https://github.com/joh/when-changed","last_synced_at":"2025-05-15T02:07:36.300Z","repository":{"id":1364114,"uuid":"1313802","full_name":"joh/when-changed","owner":"joh","description":"Execute a command when a file is changed","archived":false,"fork":false,"pushed_at":"2024-04-02T21:02:10.000Z","size":64,"stargazers_count":1226,"open_issues_count":18,"forks_count":107,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-13T00:40:43.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joh.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2011-01-31T21:25:52.000Z","updated_at":"2025-04-01T16:07:29.000Z","dependencies_parsed_at":"2024-04-02T22:23:38.063Z","dependency_job_id":"d7b1cb40-d674-4738-abe5-a65cb6c7cce9","html_url":"https://github.com/joh/when-changed","commit_stats":{"total_commits":72,"total_committers":23,"mean_commits":3.130434782608696,"dds":0.6111111111111112,"last_synced_commit":"85d7acc0e9bc0d1e54a633294657130e337f3294"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joh%2Fwhen-changed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joh%2Fwhen-changed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joh%2Fwhen-changed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joh%2Fwhen-changed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joh","download_url":"https://codeload.github.com/joh/when-changed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259383,"owners_count":22040820,"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":[],"created_at":"2024-07-31T19:01:51.779Z","updated_at":"2025-05-15T02:07:36.282Z","avatar_url":"https://github.com/joh.png","language":"Python","funding_links":[],"categories":["Python","Python (1887)","Development aids"],"sub_categories":[],"readme":"# when-changed: Run a command when a file is changed\n\n\n### What is it?\n\nTired of switching to the shell to test the changes you just made to\nyour code? Starting to feel like a mindless drone, manually running\npdflatex for the 30th time to see how your resume now looks?\n\nWorry not, when-changed is here to help! Whenever it sees that you have\nchanged the file, when-changed runs any command you specify.\n\nSo to generate your latex resume automatically, you can do this:\n\n```sh\n$ when-changed CV.tex pdflatex CV.tex\n```\n\nSweetness!\n\n\n### What do I need?\n\n- Python 2.6+\n- watchdog\n\n\n### Installation\n```sh\npip install https://github.com/joh/when-changed/archive/master.zip\n```\n\n\n### Usage\n\n```sh\nwhen-changed [OPTION] FILE COMMAND...\nwhen-changed [OPTION] FILE [FILE ...] -c COMMAND\n```\n\nFILE can be a directory. Use %f to pass the filename to the command.\n\n**Options:**\n\n- -r Watch recursively\n- -v Verbose output. Multiple -v options increase the verbosity. The maximum is 3: -vvv.\n- -1 Don't re-run command if files changed while command was running\n- -s Run command immediately at start\n- -q Run command quietly\n\n### Environment variables:\n\nwhen-changed provides the following environment variables:\n\n- WHEN_CHANGED_EVENT: reflects the current event type that occurs.\nCould be either:\n  - file_created\n  - file_modified\n  - file_moved\n  - file_deleted\n\n- WHEN_CHANGED_FILE: provides the full path of the file that has generated the event.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoh%2Fwhen-changed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoh%2Fwhen-changed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoh%2Fwhen-changed/lists"}