Skip to content

Instantly share code, notes, and snippets.

View ayayron's full-sized avatar

Aaron Hoffer ayayron

View GitHub Profile
@ayayron
ayayron / git-add-docx
Created August 29, 2016 05:43
Easily version control Office (Word, PowerPoint, and Excel) with a custom git add command
#!/bin/bash
((!$#)) && echo No document name, command ignored! && exit 1
if [ ${1: -5} == ".xlsx" ] || [ ${1: -5} == ".pptx" ] || [ ${1: -5} == ".docx" ]; then
y=${1//./}
unzip $1 -d $y
git add $1 $y
else
echo Incorrect file extension, file not added!
fi