From 2fe5376ee74e8181992900d0e85d6cd86587055a Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Sun, 14 Mar 2021 21:27:26 +1100 Subject: [PATCH] Update updater, and readme --- demo/README.md | 14 ++++++++++---- demo/update.sh | 32 ++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/demo/README.md b/demo/README.md index 83a36d7..0cb7d94 100644 --- a/demo/README.md +++ b/demo/README.md @@ -1,10 +1,16 @@ # Update demo -This is a live script that will probably only work if you have the following things installed: +This is a live script that will probably only work if you are glasnt and have the following things installed: * Python 3.7+ - * ih (latest) - * node && puppeteer - * git-version-bump and git-release + * a local dev environment with ih and a virtualenv in `venv` + * node && [`puppeteer`](https://github.com/puppeteer/puppeteer) + * git-version-bump and git-release, and creds for such See `update.sh` for update process. + +Usage: + +``` +./demo/update.sh [p|mi|ma] +``` diff --git a/demo/update.sh b/demo/update.sh index d740aeb..25125f3 100755 --- a/demo/update.sh +++ b/demo/update.sh @@ -1,39 +1,55 @@ #!/bin/bash update=${1:-p} -# WARNING ERRORONOUS +# WARNING ERRORONOUS AND CONTAINS SIDEEFFECTS + +if [[ $(git diff --stat) != '' ]]; then + echo "dirty git. will not continue" + exit 0 +fi + +branch=$(git branch | grep '*' | cut -d' ' -f2) + +if [[ "$branch" != 'latest' ]]; then + echo "not on latest branch. will not continue" + exit 0 +fi echo "We will be releasing a $update update ($(git vb $update -d))" read -r -p "Are you sure? [y/N] " response if [[ "$response" =~ ^(yes|y)$ ]] then - echo "processing" sleep 1 echo "Update CLI usage" + + source venv/bin/activate + pip install -e . + ih --version + python demo/update_readme.py - git add . && git commit -m "update cli usage" + git add README.md && git commit -m "update cli usage" echo "bump" git version-bump $update echo "use new version" - source venv/bin/activate - pip install -e . ih --version + + # Hard-copy from README.md example ih -p alpaca -r -c 4 demo/demo_image.png -f demo/ + deactivate echo "Update demo render" node demo/update_render.js - git add . && git commit -m "update demo render" + git add demo/demo_render.png && git commit -m "update demo render" git release else - echo "Not continuing" - + echo "user bailed. will not continue" fi