Skip to main content

No project description provided

Project description

run-if - conditionally run command if targets don't exist or dependencies have changed.

This is a simple python script that bascially does what checkexec (https://github.com/kurtbuilds/checkexec), but it uses a hash of the contents of the dependencies to decide if the command should be ran and supports multiple targets.

$ run-if main.cpp == g++ main.pp -o main == main

If main does not exist, or if the contents of main.cpp have changed since the last time it run-if was called, the command will be run.

The syntax is different than checkexec

$ run-if [DEPENDENCY...] == <COMMAND> == [TARGET...]

Multiple targets can be listed and both targets and dependencies can be files or directories.

$ run-if -- src/ == cmake --build build == build/test1 build/test2 build/data/

Currently the hash of dependencies are being computed with shell commands using the subprocess module, so it will fail to run if md5sum or gawk are missing, or if the default shell does not support pipes.

Install

Install run-if with pip using the run-if-changed package (run-if is too similar to another prackage already in the repository).

$ pip install run-if-changed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

run_if_changed-0.1.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

run_if_changed-0.1.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page