chore(common): use /usr/bin/env bash

Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.

This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:

```
if [[ -v _builder_params[$e] ]]; then
```
This commit is contained in:
Marc Durdin 2022-07-25 14:59:37 +10:00
parent 93a03acb9f
commit 767927bf16
55 changed files with 59 additions and 59 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build KMAPro
# Set sensible script defaults:

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build Keyman Engine Android using Keyman Web artifacts
#
# Abbreviations:

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build KMSample1
set -e

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build KeyboardHarness test app

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# CI script to publish specified app APKs to the Play Store.
# The APKs should already have been built from a separate script

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build Keyman Engine for Android, Keyman for Android, and FirstVoices Android app
# Use '-clean' flag to clean build artifacts (won't do other build steps)

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Based on /windows/src/test/i18n-check-unused-strings
#
@ -15,7 +15,7 @@
# build artifacts. Because of this, and because the script takes a little while to run,
# I'm not adding the script to the standard build at this time.
#
# Note: strings that aren't expected to be found generally should have `translateable="false"`` so they don't get
# Note: strings that aren't expected to be found generally should have `translateable="false"`` so they don't get
# translated in crowdin.
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Packages the @keymanapp/models-types package.
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications.
# Designed for optimal compatibility with the Keyman Suite.

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# The diagram is built using the Graphviz suite.
# You can get it with most package managers, e.g.,

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Compiles common TS-based utility functions for use among Keyman's codebase
set -eu

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Setup git hooks in this or all repositories.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Get the tier from TIER.md
# When building from a Linux source package, `TIER.md` is in the
# same directory as this script.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Get the version number from VERSION.md
# When building from a Linux source package, `VERSION.md` is in the
# same directory as this script.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Compiles the developer tools, including the language model compilers.
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# postbuild script run by npm during/after a build
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
# set -x

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
TARGET=KMSample1
source ../build_common.sh

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
TARGET=KMSample2
source ../build_common.sh

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Please note that this build script (understandably) assumes that it is running on Mac OS X.
if [[ "${OSTYPE}" != "darwin"* ]]; then
@ -30,7 +30,7 @@ KM4MIM_APP_PATH="$1/$KMIM_APPNAME"
if ! [[ -d "$KM4MIM_APP_PATH" ]]; then
display_usage
fi
pid=$(pgrep Keyman)
if [[ -n $pid ]]; then
kill $pid

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# TODO: deprecate and replace with shellHelperFunctions.sh.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
## START STANDARD BUILD SCRIPT INCLUDE

View file

@ -1,6 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
# compares the version of this branch (in ../VERSION.md) to the
# compares the version of this branch (in ../VERSION.md) to the
# version in the Xcode project file of the subproject named in $1
# returns zero if they are the same, non-zero if not the same or a problem occurs

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
set -u

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
set -u
make textinputsource

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set sensible script defaults:
# set -e: Terminate script if a command returns an error

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Build the keyboards referred to in ../keyboards.csv and copy them + metadata
# to the FirstVoices/Keyboards folder

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Download default keyboard and lexical model packages from downloads.keyman.com
# Set sensible script defaults:

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Prevents 'clear' on exit of mingw64 bash shell

View file

@ -1,6 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
#set -x
#set -x
#DEBUG=1
_hu_base_dir=$(dirname "$BASH_SOURCE")/../../..

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "**TODO** Update script to work with new history/versioning"
exit 1

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
set -u

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Setup JQ environment variable according to the user's system
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script centralises sentry symbol uploads and releases

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Tell TeamCity to trigger new builds

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This file maps specific paths to build triggers
#

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script will automatically have Xcode's build environment (and variables),
# so there's no need to do anything extra to fetch them.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script goes with gosh.bat and gosh.js. It may be helpful for launching
# a platform independent script "gosh foo.sh ..." where "gosh" will be interpreted

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# WARNING: this file is copied into other locations during package builds; do not

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Prevents 'clear' on exit of mingw64 bash shell

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Controls uploading and downloading Crowdin l10n files for
# Keyman for Windows.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script finds all references to strings in strings.xml in order to make sure that old