Created
April 30, 2021 01:34
-
-
Save dev-juyoung/ef44820e4fcef87764fc73e8bf867609 to your computer and use it in GitHub Desktop.
Using zeplin's ios project, move the image file according to flutter's resource structure.
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
#!/usr/bin/env bash | |
scale2="@2x.png" | |
scale3="@3x.png" | |
for name in *.png; do | |
if [[ $name =~ $scale2 ]]; then | |
rename=$(echo $name | sed 's/\@2x.png$/.png/') | |
mv $name "$1/2.0x/$rename" && echo "moved $name -> $1/2.0x/$rename" | |
# t=$(echo $name | sed 's/\@2x.png$/.png/'); | |
elif [[ $name =~ $scale3 ]]; then | |
rename=$(echo $name | sed 's/\@3x.png$/.png/') | |
mv $name "$1/3.0x/$rename" && echo "moved $name -> $1/3.0x/$rename" | |
else | |
mv $name "$1/$name" && echo "moved $name -> $1/$name" | |
fi | |
done | |
echo "\ncompleted." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go to the path where the image downloaded from zeplin is located and execute the following command.
sh {shell-file-storage-path/filename.sh} {project-path/assets-storage-path}
[Sample command]
sh ~/dev/tools/move-assets.sh ~/dev/project-name/assets/images