Using CabinJS to create my blog, but it only works with GitHub pages (so as I have a user account set-up for my domain repo CabinJS’ deployment process doesn’t work for me, which means I need to copy the dist
folder over to my website repo manually).
So rather than write a Rake task (or a Node/Grunt task) and have to spend time looking up the different File system APIs (which I always forget), I’ve decided to use standard unix commands to achieve the same thing.
Yes I’m sure it looks a lot more long winded but it works and took me a lot less time to write…
alias site="cd ~/Code/CabinJS &&
touch log.txt &&
git log --oneline -n 1 |
cut -d ' ' -f 2- |
xargs -I {} echo {} > log.txt &&
cd ../Website &&
cp -r ../CabinJS/dist/* ./ &&
git add . &&
git add -A &&
cat ../CabinJS/log.txt |
xargs -I {} git commit -m {} &&
git push origin master"
…to explain what it’s doing…
git log --pretty=oneline | sed -n 1p
- where -n
meant ‘no print’ and 1p
meant ‘print line 1’ - before I realised I could avoid sed
altogether and just use the -n 1
flag for the git log instead)dist
) into our main Website foldergit add
and git add -A
git commit
using itgit push origin master