diff --git a/docs/misc/asciinema/basic-prepare.sh b/docs/misc/asciinema/basic-prepare.sh new file mode 100755 index 000000000..d51651794 --- /dev/null +++ b/docs/misc/asciinema/basic-prepare.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +sudo rm -r /media/backup/borgdemo || true +sudo mkdir -p /media/backup/borgdemo +sudo chown "$(whoami):$(whoami)" /media/backup/borgdemo diff --git a/docs/misc/asciinema/basic.tcl b/docs/misc/asciinema/basic.tcl new file mode 100755 index 000000000..6998bab09 --- /dev/null +++ b/docs/misc/asciinema/basic.tcl @@ -0,0 +1,27 @@ +#!/usr/bin/env expect + +if {[file isdirectory /media/backup/borgdemo] == 0} { + send_user "Please, run basic-prepare.sh first\n" + exit 1 +} + +# Configuration for send -h +# Tries to emulate a human typing +# Tweak this if typing is too fast or too slow +set send_human {.05 .1 1 .01 .2} + +# The screencast uses relative paths "Wallpaper" +# We should not mess with the contents of whatever cwd happened to be +cd [exec mktemp -d] +mkdir Wallpaper + +if {0} { + spawn borg init --encryption=repokey /media/backup/borgdemo + expect "Enter new passphrase: " + send -h "correct horse battery staple\n" + expect "Enter same passphrase again: " + send -h "correct horse battery staple\n" + expect -ex {Do you want your passphrase to be displayed for verification? [yN]: } + send \n + expect eof +}