Skip to content

Commit

Permalink
update screencast record automation
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <[email protected]>
  • Loading branch information
aluzzardi committed Dec 7, 2018
1 parent d1476d9 commit 331fe55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ lint:
.PHONY: test
test: build
./test/integration.sh $(CURDIR)/chainkit

.PHONY: screencast
screencast:
./script/screencast/record.sh
12 changes: 7 additions & 5 deletions script/screencast/record.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash
set -e

ROOTDIR="$(cd "$(dirname "$0")"; pwd -P)/"

# Dependencies:
# brew install asciinema
# yarn global add svg-term-cli

rm -f "$(dirname $0)/screencast.json" "$(dirname $0)/screencast.svg"
rm -f "$ROOTDIR/screencast.json" "$ROOTDIR/screencast.svg"

asciinema rec --command 'sh "$(dirname $0)/script.sh"' "$(dirname $0)/screencast.json"
sed -i.bak "s;$HOME;~;g" screencast.json
rm -f "$(dirname $0)/screencast.json.bak"
asciinema rec --command "sh $ROOTDIR/script.sh" "$ROOTDIR/screencast.json"
sed -i.bak "s;$HOME;~;g" "$ROOTDIR/screencast.json"
rm -f "$ROOTDIR/screencast.json.bak"

svg-term --window --in "$(dirname $0)/screencast.json" --out "$(dirname $0)/screencast.svg"
svg-term --window --in "$ROOTDIR/screencast.json" --out "$ROOTDIR/screencast.svg"
3 changes: 2 additions & 1 deletion script/screencast/script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e

CHAINKIT=/Users/al/go/src/github.com/blocklayerhq/chainkit/chainkit
ROOTDIR="$(cd "$(dirname "$0")"; pwd -P)/"
CHAINKIT="$ROOTDIR/../../chainkit"

rm -rf ~/go/src/github.com/demoapp
cd ~/go/src/github.com
Expand Down

0 comments on commit 331fe55

Please sign in to comment.