lib/fs.js
// Rename a single file if it meets some criteria.
Rename a single file if it meets some criteria.
Rename a single file if it meets some criteria .
renameIf( file, criteria, callback ) {
      if( context.fs.exists(file) ) {
        const proceed = _.isFunction(criteria) ? criteria(file) : criteria;
        if( proceed ) utils.rename(file, callback);
      }
    }
renameIf ( file , criteria , callback ) { if ( context . fs . exists ( file ) ) { const proceed = _ . isFunction ( criteria ) ? criteria ( file ) : criteria ; if ( proceed ) utils . rename ( file , callback ) ; } }
Rename a single file if it meets some criteria.
Rename a single file if it meets some criteria .
// Verify that the path exists. // Determine whether or not the criteria has been met. // Only proceed to rename the file if the criteria has been met.