jj/demos/setup_standard_config.sh
Ilya Grigoriev 926c117955 demos: run scripts in a fixed environment and record with term-transcript
Currently, there is no way provided to merely run scripts in
a fixed environment (without recording).

Short-term TODOs (done in descendant commits):
  - Fix the terminal width
  - Document the script
2023-10-03 23:52:28 -07:00

28 lines
506 B
Bash

# This script is meant to be run with `source` from a fresh bash
# shell. Thus no shebang.
# shellcheck shell=bash
set -euo pipefail
JJ_CONFIG=$(mktemp --tmpdir jjconfig-XXXX.toml)
export JJ_CONFIG
cat <<'EOF' > "$JJ_CONFIG"
[user]
name = "JJ Fan"
email = "jjfan@example.com"
[operation]
hostname = "jujube"
username = "jjfan"
[ui]
color="always"
paginate="never"
EOF
GIT_CONFIG_GLOBAL=$(mktemp --tmpdir gitconfig-XXXX)
export GIT_CONFIG_GLOBAL
cat <<'EOF' > "$GIT_CONFIG_GLOBAL"
[color]
ui=always
EOF