From de1acc32cb4954f85e0230faae7915c53a6b3118 Mon Sep 17 00:00:00 2001 From: Kevin Zhuang Date: Tue, 28 Jul 2020 11:10:55 +1000 Subject: [PATCH] ci: specify COLUMNS as env to avoid inconsisten test result --- .github/workflows/ci.yml | 3 +++ buildspec.yml | 2 ++ helper/set_variable.sh | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9298f8..169561d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: CI on: [push, pull_request] +env: + COLUMNS: 80 + defaults: run: shell: bash diff --git a/buildspec.yml b/buildspec.yml index 4e3cf87..83e56c1 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -4,6 +4,8 @@ env: parameter-store: LOGIN_PASSWORD: /dotbare/dockerpassword LOGIN_USERNAME: /dotbare/dockerusername + exported-variables: + COLUMNS: 80 phases: install: diff --git a/helper/set_variable.sh b/helper/set_variable.sh index b81608c..60c4da7 100644 --- a/helper/set_variable.sh +++ b/helper/set_variable.sh @@ -41,7 +41,8 @@ FZF_DEFAULT_OPTS=" $DOTBARE_KEY " -COLUMNS=$(stty size < /dev/tty | cut -d' ' -f2) +[[ -z "${COLUMNS}" ]] \ + && COLUMNS=$(stty size < /dev/tty | cut -d' ' -f2) [[ "${COLUMNS}" -lt 80 ]] \ && FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --preview-window=hidden"