Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active May 6, 2019 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/de5c03dd26e509ab95a21e50ca79b80f to your computer and use it in GitHub Desktop.
Save clifgriffin/de5c03dd26e509ab95a21e50ca79b80f to your computer and use it in GitHub Desktop.
Remove plugins and re-add with composer.
#!/bin/bash
for plugin in `wp plugin list | grep -v "on line" | grep -v "version" | awk '{print $1}'`; do
if search_result=$(composer search wpackagist-plugin/$plugin | grep "^wpackagist-plugin/$plugin$")
then
git rm -r wp-content/plugins/$plugin
git commit -m "Temporarily removed $plugin"
composer require wpackagist-plugin/$plugin
echo "wp-content/plugins/$plugin" >> .gitignore
git add -A
git commit -m "Re-installed $plugin"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment