Created
December 9, 2014 18:27
-
-
Save luispedrofonseca/3f80522973c7b243bc28 to your computer and use it in GitHub Desktop.
Bash script to sort files exported from Affinity Designer into size folders
This file contains hidden or 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 | |
# Creates folders to sort files exported by Affinity Designer | |
mkdir -p images | |
mkdir -p images/2x | |
mkdir -p images/3x | |
for file in ./*2x.png | |
do | |
if [ -f "$file" ] | |
then | |
newName=$(basename ${file/@2x}) | |
mv $file images/2x/$newName | |
fi | |
done | |
for file in ./*3x.png | |
do | |
if [ -f "$file" ] | |
then | |
newName=$(basename ${file/@3x}) | |
mv $file images/3x/$newName | |
fi | |
done | |
for file in ./*.png | |
do | |
if [ -f "$file" ] | |
then | |
mv $file images | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment