mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
Merge pull request #29 from overleaf/jpa-fix-lint
[misc] fix code linting errors in bin/ scripts
This commit is contained in:
commit
530fed2fee
4 changed files with 19 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
15
bin/upgrade
15
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue