1

目标:加快Terminalizer的终端演员(记录)

我有使用 Terminalizer 创建的终端记录。cast.yaml

# The configurations that used for the recording, feel free to edit them
config:
  # do not touch it

# Records, feel free to edit them
records:
  - delay: 841
    content: "\e]1337;RemoteHost=kyb@kyb-nuc\a\e]1337;CurrentDir=/home/kyb/devel/git-rev-label\a\e]1337;ShellIntegrationVersion=7;shell=fish\a"
  - delay: 19
    content: "\e]1337;RemoteHost=kyb@kyb-nuc\a\e]1337;CurrentDir=/home/kyb/devel/git-rev-label\a\e]0;fish /home/kyb/devel/git-rev-label\a\e[30m\e(B\e[m"
  - delay: 6
    content: "\e[?2004h"
  - delay: 28
    content: "\e]0;fish /home/kyb/devel/git-rev-label\a\e[30m\e(B\e[m\e[2m⏎\e(B\e[m                                                                                                                                                        \r⏎ \r\e[K\e]133;D;0\a\e]133;A\a\e[44m\e[30m ~/d/git-rev-label \e[42m\e[34m \e[42m\e[30m demo  \e[30m\e(B\e[m\e[32m \e[30m\e(B\e[m\e]133;B\a\e[K"
  - delay: 1202
    content: "#\b\e[38;2;231;197;71m#\e[30m\e(B\e[m"
  - delay: 134
    content: "\e[38;2;231;197;71m#\e[30m\e(B\e[m"
  - delay: 489
    content: "\e[38;2;231;197;71m \e[30m\e(B\e[m"
  - delay: 318

我想加快回报而不传递--speed-factorterminalizer play. 这样做delays 应该减少。

所以,我需要创建yq-expression 来降低延迟

.records.delay=.records.delay/3

但这个表达式不起作用。请帮忙写一个合适的。

4

1 回答 1

1

.records 是一个数组,所以你可以使用这个过滤器:

.records |= map(.delay /= 3)

或者您可能更喜欢:

.records[].delay |= (. /= 3)
于 2019-08-23T13:01:19.807 回答