PHP Classes

File: vendor/wp-cli/wp-cli/utils/auto-composer-update.sh

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Nolimitbuzz WP Theme   vendor/wp-cli/wp-cli/utils/auto-composer-update.sh   Download  
File: vendor/wp-cli/wp-cli/utils/auto-composer-update.sh
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Nolimitbuzz WP Theme
WordPress theme to used as start of new themes
Author: By
Last change:
Date: 27 days ago
Size: 980 bytes
 

Contents

Class file image Download
#!/bin/bash ### # Runs composer update, commits changes to a new branch, # and creates a pull request. # # Requires git, composer, and hub ### date if [ -z "$WP_CLI_DIR" ]; then echo 'Please set $WP_CLI_DIR' exit 1 fi set -ex cd $WP_CLI_DIR # Reset WP-CLI directory to baseline git checkout -f master git pull origin master composer install # Run composer update and capture to untracked log file composer update --no-progress --no-interaction |& tee vendor/update.log UPDATE=$(cat vendor/update.log | col -b) # We only care to proceed when there are changes if [ -z "$(git status -s)" ]; then echo 'No updates available' exit 0; fi # Create a dated branch and commit the changes DATE=$(date +%Y-%m-%d) BRANCH="update-deps-$DATE" git branch -f $BRANCH master git checkout $BRANCH git add . MESSAGE="Update Composer dependencies ($DATE) \`\`\` $UPDATE \`\`\`" git commit -n -m "$MESSAGE" # Push and pull request git push origin $BRANCH hub pull-request -m "$MESSAGE"