Created
November 4, 2021 14:49
-
-
Save MagneFire/968929530901361543fa5bf15ca4567c to your computer and use it in GitHub Desktop.
Easily create a new layer for a new smartwatch (AsteroidOS).
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 | |
SRC="$1" | |
DST="$2" | |
echo $PWD | |
if [ -d "meta-$DST-hybris/" ]; then | |
echo "Destination layer (meta-$DST-hybris) already exists!" | |
exit | |
fi | |
cp -r meta-$SRC-hybris/ meta-$DST-hybris/ | |
cd meta-$DST-hybris/ | |
FILES=$(find . -name "*$SRC*") | |
for f in $FILES | |
do | |
mv "$f" "${f/$SRC/$DST}" | |
done | |
find . -type f -exec sed -i "s/"$SRC"/$DST/g" {} \; | |
rm -rvf .git/ | |
cp -r ../meta-$SRC-hybris/.git . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment