程序重新运行,例如,文件被修改时的`make`?

Dav*_*ver 7 makefile

是否有自动重新运行的程序,例如,make文件被修改时?

例如,当我编写sphinx文档时,如果make html每次编辑任何相关文件时都会自动运行,那就太好了.

Wal*_* IV 11

对于简单的事情,重新运行可能是一个很好的选择:http://pypi.python.org/pypi/rerun

"每当在当前目录或其子目录中修改文件时,命令行可执行Python脚本重新运行给定命令."

它需要一个Python解释器,但不关心你的命令或文件是用Python编写的.

Usage

rerun [--help|-h] [--verbose|-v] [--ignore|-i=<file>] [--version] <command>
Where:

<command>           Command to execute
--help|-h           Show this help message and exit.
--ignore|-i=<file>  File or directory to ignore. Any directories of the
                    given name (and their subdirs) are excluded from the
                    search for changed files. Any modification to files of
                    the given name are ignored. The given value is
                    compared to basenames, so for example, "--ignore=def"
                    will skip the contents of directory "./abc/def/" and
                    will ignore file "./ghi/def". Can be specified multiple
                    times.
--verbose|-v        Display the names of changed files before the command
                    output.
--version           Show version number and exit.
Run Code Online (Sandbox Code Playgroud)


ara*_*uzo 6

在 Linux 中,您可以使用以下命令行:

while true; do inotifywait -e close_write  *.py; make; done
Run Code Online (Sandbox Code Playgroud)

使用标准系统命令inotifywait,如果不可用,请使用以下命令进行安装:

sudo apt install inotify-tools
Run Code Online (Sandbox Code Playgroud)