[NEW] record-shell: record shell sessions for librecode
We need to record shell sessions in a standardized way, so I made a script to accomplish this!
This commit is contained in:
parent
3fccfc023d
commit
2269df14d6
1 changed files with 47 additions and 0 deletions
47
scripts/record-shell
Executable file
47
scripts/record-shell
Executable file
|
|
@ -0,0 +1,47 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
: '
|
||||||
|
* Record sessions with Asciinema for the Librecode project!
|
||||||
|
'
|
||||||
|
|
||||||
|
read -d '' usage <<EOUSAGE
|
||||||
|
Usage: $0 [-h]
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-h Display this help.
|
||||||
|
EOUSAGE
|
||||||
|
|
||||||
|
while getopts 'h' opt; do
|
||||||
|
case "${opt}" in
|
||||||
|
h)
|
||||||
|
excat "$usage"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
dedcat "$usage"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
. "$(dirname $0)/util/logging.bash"
|
||||||
|
. /etc/os-release
|
||||||
|
|
||||||
|
timestamp=$(mktimestamp)
|
||||||
|
|
||||||
|
case "${ID}" in
|
||||||
|
arch)
|
||||||
|
SUB_ID="${BUILD_ID}"
|
||||||
|
;;
|
||||||
|
debian)
|
||||||
|
SUB_ID="${VERSION_CODENAME}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
SUB_ID="unknown"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
rec_prefix="$HOME/librecode/sessions/mine/$ID/$SUB_ID"
|
||||||
|
mkdir -p "$rec_prefix"
|
||||||
|
|
||||||
|
asciinema rec "$rec_prefix/$timestamp"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue