| 1 |
#!/bin/zsh |
| 2 |
|
| 3 |
# brew install coreutils |
| 4 |
# The real GNU cp is required for cp -Rl |
| 5 |
|
| 6 |
# Start |
| 7 |
|
| 8 |
plugin="meow-gallery" |
| 9 |
echo "Link with Meow Gallery Pro." |
| 10 |
|
| 11 |
# Copy the files |
| 12 |
|
| 13 |
dirs=(app classes common languages) |
| 14 |
for x ($dirs); do |
| 15 |
rm -Rf $x |
| 16 |
/usr/local/opt/coreutils/bin/gcp -Rl $PWD/../$plugin$plugin-pro/$x$x . |
| 17 |
done |
| 18 |
|
| 19 |
# Delete useless files |
| 20 |
|
| 21 |
rm -Rf $PWD/app/*.map |
| 22 |
rm -Rf $PWD/app/admin |
| 23 |
rm -Rf $PWD/app/galleries |
| 24 |
rm -Rf $PWD/app/less |
| 25 |
rm -Rf $PWD/common/js |
| 26 |
|
| 27 |
# Delete common only-PRO files |
| 28 |
rm -Rf $PWD/common/premium |
| 29 |
|
| 30 |
# Copy main files |
| 31 |
|
| 32 |
rm $plugin.php |
| 33 |
rm readme.txt |
| 34 |
cp $PWD/../$plugin$plugin-pro/$plugin$plugin-pro.php ./$plugin$plugin.php |
| 35 |
cp $PWD/../$plugin$plugin-pro/readme.txt ./readme.txt |
| 36 |
|
| 37 |
# Modify main files |
| 38 |
|
| 39 |
sed -i '' 's/ (Pro)//g' ./$plugin$plugin.php |
| 40 |
sed -i '' 's/ (Pro)//g' ./readme.txt |
| 41 |
|
| 42 |
echo "Done." |
| 43 |
|