2 # Copyright © 2021 Steve Youngs. All rights reserved.
3 # SPDX-License-Identifier: BSD-3-Clause
5 # Author: Steve Youngs <steve@sxemacs.org>
6 # Maintainer: Steve Youngs <steve@sxemacs.org>
7 # Created: <2021-06-23>
8 # Time-stamp: <Wednesday 23 Jun 2021 12:01:33 (steve)>
9 # Homepage: https://git.sxemacs.org/pkgusr
10 # Keywords: pkgusr package-management tools
12 ## This file is part of pkgusr
16 # Runs all the executable scripts found in a directory, but not
17 # "backup" files (*.bak, *.orig, *.new, *.rej, *~)
19 # This script is based on the one that Pat Volkerding ships with
22 # keep going when something fails
26 echo "Usage: run-parts <directory>"
31 echo "Not a directory: $1"
32 echo "Usage: run-parts <directory>"
37 for SCRIPT in $1/* ; do
38 # Skip backup, non-regular, non-executable files
39 if [[ "$SCRIPT" =~ ^.*(~|#|\.(bak|orig|new|rej))$ ||
40 ! -f $SCRIPT || ! -x $SCRIPT ]]; then
43 # Run what makes it this far.
44 $SCRIPT || echo "$SCRIPT failed."
49 ### run-parts ends here