Created
April 4, 2023 20:24
-
-
Save nicksteffens/b487c54d66bede9f01a743597d9beff1 to your computer and use it in GitHub Desktop.
allows rapid copying of svgs from a srcDir to destDir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set the source and destination directories | |
SRC_DIR="$1" | |
DEST_DIR="$2" | |
# Loop through all SVG files in the source directory | |
for svg_file in "$SRC_DIR"/*.svg | |
do | |
# Get the filename without the path or extension | |
filename=$(basename "$svg_file" .svg) | |
# Prepend the directory name to the filename | |
new_filename="$(basename $SRC_DIR)-$filename.svg" | |
# Copy the file to the destination directory with the new filename | |
cp "$svg_file" "$DEST_DIR/$new_filename" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment