Skip to content

Instantly share code, notes, and snippets.

@luispedrofonseca
Created December 9, 2014 18:27
Show Gist options
  • Save luispedrofonseca/3f80522973c7b243bc28 to your computer and use it in GitHub Desktop.
Save luispedrofonseca/3f80522973c7b243bc28 to your computer and use it in GitHub Desktop.
Bash script to sort files exported from Affinity Designer into size folders
#!/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