mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-10 14:16:24 +03:00
986fced69e
The demos don't need to be animated - the user wouldn't miss anything if they skipped to the end. So let's just show the full output so the user can read through it at their own pace. We could use plain text, but I think the colors are helpful, so I went with screenshots. Closes #166.
27 lines
351 B
Bash
27 lines
351 B
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
new_tmp_dir() {
|
|
local dirname
|
|
dirname=$(mktemp -d)
|
|
mkdir -p "$dirname"
|
|
cd "$dirname"
|
|
trap "rm -rf '$dirname'" EXIT
|
|
}
|
|
|
|
run_command() {
|
|
echo "\$ $@"
|
|
eval "$@"
|
|
}
|
|
|
|
blank() {
|
|
echo ""
|
|
}
|
|
|
|
comment() {
|
|
indented="$(echo "$@"| sed 's/^/# /g')"
|
|
blank
|
|
echo -e "\033[0;32m${indented}\033[0m"
|
|
blank
|
|
}
|