Improved algorithm to be recursive
This commit is contained in:
parent
5ce4a401f8
commit
a4f344cf52
1 changed files with 2 additions and 2 deletions
|
|
@ -4,10 +4,10 @@ SOURCE_DIR=$(dirname -- "${BASH_SOURCE[0]}")
|
|||
EXTRACTION_DIR=$SOURCE_DIR/selection/
|
||||
SFW_DIR=$SOURCE_DIR/sfw/
|
||||
|
||||
EXTRACTED_FILE=$EXTRACTION_DIR$(ls $SOURCE_DIR/selection/ | shuf -n 1 -)
|
||||
EXTRACTED_FILE=$(find -L $SOURCE_DIR/selection/ -type f | shuf -n 1)
|
||||
|
||||
magick $EXTRACTED_FILE $SOURCE_DIR/selected.jpg
|
||||
|
||||
if [ "$OVERRIDE_SFW" = "1" ]; then
|
||||
cp $SFW_DIR$(ls $SFW_DIR | shuf -n 1 -) $SOURCE_DIR/selected.jpg
|
||||
magick $(find -L $SFW_DIR -type f | shuf -n 1) $SOURCE_DIR/selected.jpg
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue