scripts: use [[ instead of [, fix literal shell globs (#11290)

* build.sh: move `*` outside quotes (it doesn't get expanded)

* scripts: use `[[` instead of `[` in if statements
This commit is contained in:
Lena
2023-10-26 18:41:24 +02:00
committed by GitHub
parent 1ba64fc0d7
commit 250b9d7c21
4 changed files with 18 additions and 18 deletions

View File

@@ -5,11 +5,11 @@
set -ex
function initialize {
if [ -z "$TLDRHOME" ]; then
if [[ -z $TLDRHOME ]]; then
export TLDRHOME=${GITHUB_WORKSPACE:-$(pwd)}
fi
if [ -z "$TLDR_LANG_ARCHIVES_DIRECTORY" ]; then
if [[ -z $TLDR_LANG_ARCHIVES_DIRECTORY ]]; then
export TLDR_LANG_ARCHIVES_DIRECTORY="${GITHUB_WORKSPACE:-$(pwd)}/language_archives"
fi
@@ -32,11 +32,11 @@ function build_translation_archives {
local source_directory="$TLDRHOME"
local target_directory="$TLDR_LANG_ARCHIVES_DIRECTORY"
mkdir -p "$target_directory"
rm -f "$target_directory/*"
rm -f "$target_directory"/*
for lang_dir in "$source_directory"/pages*; do
# Skip symlinks (pages.en) and things that are not directories
if [ ! -d "$lang_dir" ] || [ -h "$lang_dir" ]; then
if [[ ! -d $lang_dir || -h $lang_dir ]]; then
continue
fi