Project

General

Profile

« Previous | Next » 

Revision 9062

lib/sh/util.sh: added require_exists (), used to skip make commands for existing files

View differences:

lib/sh/util.sh
276 276
top_script="$0" # outermost script
277 277
top_dir="$(dirname "$top_script")"
278 278

  
279
require_exists () # usage: require_exists file || return 0
280
{ test ! -e "$1" || die "? file "$1" already exists, skipping"; }
281

  
279 282
# auto-removes a command's output file on error (like make's .DELETE_ON_ERROR)
280 283
function to_file () # usage: stdout=... [if_not_exists=1] to_file cmd...
281 284
{

Also available in: Unified diff