From c3e438805f2cabd77b507a0b768e14f666f0ce96 Mon Sep 17 00:00:00 2001 From: Matt Troutman Date: Fri, 27 Sep 2024 10:10:06 -0500 Subject: [PATCH] Prep 1 font script to get each font ready --- prep 1 font.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 prep 1 font.sh diff --git a/prep 1 font.sh b/prep 1 font.sh new file mode 100755 index 0000000..46c3cdb --- /dev/null +++ b/prep 1 font.sh @@ -0,0 +1,32 @@ +#! /bin/zsh + +#if current working directory is named font_files or custom_fonts, exit +if [[ $PWD == *"font_files"* ]] || [[ $PWD == *"custom_fonts"* ]]; then + echo "You are in the wrong directory. Please move to the individual font folder." + exit +fi + +#recursively find all .zip files and unzip them +find . -name '*.zip' -exec unzip {} \; + +# Make OTF and TTF folders if they don't exist +mkdir -p OTF TTF "other files" + +# Recurse through all folders and subfolders and move files that are not .ttf or .otf into the "other files" folder +find . -type f -exec mv {} "other files" \; + +# Recurse through all folders and subfolders and delete all .DS_Store files +find . -name '.DS_Store' -type f -delete +# Recurse through all folders and subfolders and delete all .g2n files +find . -name '*.g2n' -type f -delete +find . -name '*.ofm' -type f -delete +find . -name '*.cfg' -type f -delete +find . -name '*.zip' -type f -delete + +# Recurse through all folders and subfolders and move all .ttf files into the TTF folder +find . -name '*.ttf' -type f -exec mv {} TTF \; +# Recurse through all folders and subfolders and move all .otf files into the OTF folder +find . -name '*.otf' -type f -exec mv {} OTF \; + +# Recurse through all folders and subfolders and delete all empty folders +find . -type d -empty -delete \ No newline at end of file