Re: [A-a-p-user] Running a command if any files are copied.
Brought to you by:
vimboss
From: Bram M. <Br...@mo...> - 2005-09-16 18:02:25
|
Mike Ellis wrote: > Thanks, Bram, the script works correctly now for one file. (I had to > change :cp to :copy). Sorry, I forget the synax of commands sometimes. Actually, I'm wondering if Aap will become simpler to use when the Aap commands would take arguments like the Unix commands. > As for udevstart, it should run _one time only _ if one or more > changed files are installed. The situation is almost analogous to > compile and link, where the linker runs only if any files are > compiled. > > This seems to me a fairly common need, e.g. to install changed > configuration files for a daemon and conditionally restart the daemon. You could set a variable in the block where the file is copied, and then at the "finally" target check for it: didit = 0 didi : dodo :copy {f} $source $target didit = 1 ... finally: @if _no.didit: :sys run the command -- They now pass three KNIGHTS impaled to a tree. With their feet off the ground, with one lance through the lot of them, they are skewered up like a barbecue. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html /// |