Created
September 22, 2021 11:55
-
-
Save peterjaap/c440ac9f7acfd331ffe526c9a82f65af to your computer and use it in GitHub Desktop.
Magento 2 - move duplicate themes files to new theme
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
#!/bin/bash | |
# Move duplicate themes files to new theme | |
OLDVENDOR="Vendor" | |
NEWVENDOR="Newvendor" | |
NEWTHEMENAME="Themename" | |
find app/design/frontend ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD | cut -d' ' -f3 | while read a; | |
do | |
OLDTHEMENAME=$(echo $a | cut -d '/' -f5) | |
FILEPATH=$(echo $a | sed "s/${OLDVENDOR}/${NEWVENDOR}/" | sed "s/${OLDTHEMENAME}/${NEWTHEMENAME}/") | |
mkdir -p `dirname $FILEPATH` | |
cp $a $FILEPATH | |
rm $a | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment