diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6052d..f1a1336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ - `bin/upgrade` displays any changes to the changelog and prompts for confirmation before applying the remote changes to the local branch. +### Misc +- Fix code linting errors in bin/ scripts + ## 2020-11-19 ### Added - Updated default [`version`](https://github.com/overleaf/toolkit/blob/master/lib/config-seed/version) to 2.5.0 diff --git a/bin/docker-compose b/bin/docker-compose index 7a613db..e69978b 100755 --- a/bin/docker-compose +++ b/bin/docker-compose @@ -18,7 +18,8 @@ fi RC_FILE="$TOOLKIT_ROOT/config/overleaf.rc" function __main__() { - local SHARELATEX_IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/version")" + local SHARELATEX_IMAGE_VERSION + SHARELATEX_IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/version")" local MONGO_IMAGE="mongo:4.0" local REDIS_IMAGE="redis:5.0" diff --git a/bin/doctor b/bin/doctor index c2b87a2..53ab1cc 100755 --- a/bin/doctor +++ b/bin/doctor @@ -26,7 +26,8 @@ function add_warning() { function indent_to_level() { local levels="$1" local number_of_spaces=$(( levels * SPACES_PER_INDENT )) - local spaces="$(printf %${number_of_spaces}s)" + local spaces + spaces="$(printf %${number_of_spaces}s)" echo -n "${spaces}" } @@ -85,7 +86,8 @@ function check_dependencies() { print_point 1 "$binary_name" if [[ -n $(command -v "$binary_name") ]]; then print_point 2 "status: present" - local version=$(get_version "$binary_name") + local version + version=$(get_version "$binary_name") print_point 2 "version info: $version" if [[ "$binary_name" == "realpath" ]] \ && [[ "$(command -V "$binary_name")" =~ .*function.* ]]; then diff --git a/bin/upgrade b/bin/upgrade index 22c39c4..5c626a6 100755 --- a/bin/upgrade +++ b/bin/upgrade @@ -28,7 +28,8 @@ function usage() { } function services_up() { - local top_output="$("$TOOLKIT_ROOT/bin/docker-compose" top)" + local top_output + top_output="$("$TOOLKIT_ROOT/bin/docker-compose" top)" if [[ -z "$top_output" ]]; then return 1 else @@ -38,8 +39,10 @@ function services_up() { function git_pull_available() { local branch="$1" - local fetch_output="$(git -C "$TOOLKIT_ROOT" fetch --dry-run origin "$branch" 2>&1)" - local filtered_fetch_output="$(echo "$fetch_output" | grep '\-> origin/'"$branch")" + local fetch_output + fetch_output="$(git -C "$TOOLKIT_ROOT" fetch --dry-run origin "$branch" 2>&1)" + local filtered_fetch_output + filtered_fetch_output="$(echo "$fetch_output" | grep '\-> origin/'"$branch")" if [[ -z "$filtered_fetch_output" ]]; then return 1 else @@ -85,8 +88,10 @@ function show_changes() { } function handle_image_upgrade() { - local user_image_version="$(head -n 1 "$TOOLKIT_ROOT/config/version")" - local seed_image_version="$(head -n 1 "$TOOLKIT_ROOT/lib/config-seed/version")" + local user_image_version + user_image_version="$(head -n 1 "$TOOLKIT_ROOT/config/version")" + local seed_image_version + seed_image_version="$(head -n 1 "$TOOLKIT_ROOT/lib/config-seed/version")" if [[ ! "$seed_image_version" > "$user_image_version" ]]; then echo "No change to docker image version"