48 lines
No EOL
1.8 KiB
Bash
Executable file
48 lines
No EOL
1.8 KiB
Bash
Executable file
#! /bin/zsh
|
|
|
|
|
|
|
|
#uncomment if you want to delete all .setup_complete files and process everything
|
|
#find . -name '*.setup_complete' -type f -delete
|
|
|
|
#if file name .setup_complete exists, exit
|
|
if [ -f .setup_complete ]; then
|
|
echo "This folder has already been prepped. Please delete the .setup_complete file if you would like to run this script again."
|
|
exit
|
|
fi
|
|
|
|
|
|
#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 .ttc files into the ttf folder
|
|
find . -name '*.ttc' -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
|
|
# create a .setup_complete file to indicate that the folder has been prepped
|
|
touch .setup_complete |