-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
scaffold.sh
executable file
·28 lines (17 loc) · 961 Bytes
/
scaffold.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
if [[ $1 = '' ]]
then
echo "Please enter plugin slug (use CamelCase)"
else
find . -depth -type d -path '*WordpressMagicBoilerplate' | sed 'p;s:WordpressMagicBoilerplate:'$1':' | xargs -n2 mv
find . -depth -type f -name 'WordpressMagicBoilerplate*' | sed 'p;s:WordpressMagicBoilerplate:'$1':' | xargs -n2 mv
find . -depth -type f -name 'wordpress-magic-boilerplate*' | sed 'p;s:wordpress-magic-boilerplate:'$1':' | xargs -n2 mv
find . -depth -type f \( -name "*.js" -o -name "*.php" -o -name "*.css" -o -name "*.less" -o -name "*.json" -o -name "*.pot" \) -exec sed -i -r 's/WordpressMagicBoilerplate/'$1'/g' {} \;
find . -depth -type f \( -name "*.js" -o -name "*.php" -o -name "*.css" -o -name "*.less" -o -name "*.json" -o -name "*.pot" \) -exec sed -i -r 's/wordpress-magic-boilerplate/'$1'/g' {} \;
# Hack for MaC
find . -type f -name '*-r' -delete
rm -rf .git
rm -rf .github
mv -f $(pwd) "$(dirname "$(pwd)")/$1"
rm -- "$0"
fi