Skip to content

Instantly share code, notes, and snippets.

View richard-muvirimi's full-sized avatar

Richard Muvirimi richard-muvirimi

View GitHub Profile
@richard-muvirimi
richard-muvirimi / opencart-module-extract.sh
Created May 25, 2022 14:03
Extracts an OpenCart module from a development environment. Just pass the name of the module and will extract and create a zip of the module.
#! /bin/bash
# Usage --filename--.sh --module-name--
# Where `--filename--.sh` is the name of the file and
# `--module-name--` is the name of the module provided the name is the same throughout
if [[ $# -eq 0 ]] ; then
echo 'Please specify the files to find'
exit 0
fi
@richard-muvirimi
richard-muvirimi / wp-plugin-extract.sh
Last active May 25, 2022 15:31
Extract a WordPress plugin into an svn directory for commit. Assumes the repository is already checked and you are using gi for version control. Will create a tag based on the Stable tag set in readme.txt
#!/bin/sh
#extract stable version name, case insensitive
version=$(find . -iname "README.TXT" -exec grep -oP 'Stable.*:\s\K.*' {} \;)
directory=$(basename "$PWD")
#target directory, I prefer my home dir
target="$HOME/Documents/Projects/svn-wordpress/$directory/trunk/"
echo "Version is $version"