mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-29 02:54:04 +00:00
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.
This commit is contained in:
parent
234cb15ff8
commit
b1d473eafb
2 changed files with 1 additions and 9 deletions
|
@ -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"
|
||||
'
|
||||
|
|
|
@ -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 {} {
|
||||
|
|
Loading…
Reference in a new issue