Skip to content

Instantly share code, notes, and snippets.

View basscl's full-sized avatar

Eileen Mack basscl

  • Square Candy Design
View GitHub Profile
@basscl
basscl / get_latest_release.sh
Created July 14, 2021 01:00 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@basscl
basscl / wp-list-updates-needed.sh
Last active July 13, 2021 20:49
Shell command to list WP core/plugin updates needed
#!/bin/bash
echo -e "`wp option get home`\nWP Core `wp core version``wp core check-update --fields=version --format=csv 2>/dev/null | grep -v [a-z] | sed 's/\([0-9].[0-9].[0-9]\)/ -> \1/g'` \n`wp plugin list --status=active --fields=name,update,version,update_version 2>/dev/null | grep -vE 'none|higher than expected' | sed '1d' | sed 's/[[:space:]]available[[:space:]]/ /g' | sed 's/[[:space:]]\([0-9]*.[0-9]*.[0-9]*\)[[:space:]]\([0-9]*.[0-9]*.[0-9]*\)/ \1 -> \2/g'`"