From b1d473eafb06fe98476e132860b25ea3e5ffc11a Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 22 Oct 2021 14:17:37 -0700 Subject: [PATCH] demos: make `run_command` wait for the prompt Most commands are non-interactive, so this reduces duplication. We can add another function for running a command and not waiting for a prompt when we need it. --- demos/demo_git_compat.sh | 8 -------- demos/demo_helpers.tcl | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/demos/demo_git_compat.sh b/demos/demo_git_compat.sh index 6fe30e77c..471e7555d 100755 --- a/demos/demo_git_compat.sh +++ b/demos/demo_git_compat.sh @@ -6,20 +6,12 @@ parse_args "$@" new_tmp_dir run_demo ' -expect_prompt run_command "# Clone a Git repo:" -expect_prompt run_command "jj git clone https://github.com/octocat/Hello-World" -expect_prompt run_command "cd Hello-World" -expect_prompt run_command "# Inspect it:" -expect_prompt run_command "jj log" -expect_prompt run_command "jj diff -r b1" -expect_prompt run_command "# The repo is backed by the actual Git repo:" -expect_prompt run_command "git --git-dir=.jj/store/git log --graph --all --decorate --oneline" ' diff --git a/demos/demo_helpers.tcl b/demos/demo_helpers.tcl index e01d6c56a..7de573fe3 100644 --- a/demos/demo_helpers.tcl +++ b/demos/demo_helpers.tcl @@ -8,7 +8,7 @@ proc expect_prompt {} { proc run_command {cmd} { send -h "$cmd" send "\r" - expect -timeout 1 + expect -timeout 5 "$ " } proc quit_and_dump_asciicast_path {} {