Skip to content

chore: Prefer [[ over [ in bash build scripts #2543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if [[ "${CODER_LIBSH_NO_CHECK_DEPENDENCIES:-}" != *t* ]]; then
# we capture the version output first before
make_version_raw="$(make --version 2>/dev/null)"
make_version="$(echo "$make_version_raw" | head -n1 | grep -oE '([[:digit:]]+\.){1,2}[[:digit:]]+')"
if [ "${make_version//.*/}" -lt 4 ]; then
if [[ ${make_version//.*/} -lt 4 ]]; then
libsh_bad_dependencies=1
log "ERROR: You need at least make 4.0 to run the scripts in the Coder repo."
if isdarwin; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/sign_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ rc=0
for i in $(seq 1 2); do
gon "$config" && rc=0 && break || rc=$?
log "gon exit code: $rc"
if [ "$i" -lt 5 ]; then
if [[ $i -lt 5 ]]; then
log
log "Retrying notarization in 60 seconds"
log
Expand Down
2 changes: 1 addition & 1 deletion scripts/yarn_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
# --check-files
)

if [ -n "${CI:-}" ]; then
if [[ -n ${CI:-} ]]; then
yarn_flags+=(
# Install dependencies from lockfile, ensuring builds are fully
# reproducible
Expand Down