summaryrefslogtreecommitdiffhomepage
path: root/android/scripts
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2024-01-25 11:44:41 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-02-02 11:04:48 +0100
commitb6e0545e1b5ae2fbcb6655bd4d28739cf9f943d6 (patch)
tree40644f1100793192c23fd7491978dc26ad1fef97 /android/scripts
parent1438e369b10bbf50900d9e380329001513de2c1e (diff)
downloadmullvadvpn-b6e0545e1b5ae2fbcb6655bd4d28739cf9f943d6.tar.xz
mullvadvpn-b6e0545e1b5ae2fbcb6655bd4d28739cf9f943d6.zip
Fix `shellcheck` lints of our various bash scripts
The following lints have been fixed: SC2046,SC2086,SC2068,SC2148,SC2007,SC2004,SC2006, SC2164,SC2145,SC1091,SC2034,SC2155.
Diffstat (limited to 'android/scripts')
-rwxr-xr-xandroid/scripts/generate-pngs.sh11
-rwxr-xr-xandroid/scripts/run-instrumented-tests-locally.sh4
-rwxr-xr-xandroid/scripts/run-instrumented-tests.sh6
3 files changed, 12 insertions, 9 deletions
diff --git a/android/scripts/generate-pngs.sh b/android/scripts/generate-pngs.sh
index 6aa4aa380e..dc72e9f538 100755
--- a/android/scripts/generate-pngs.sh
+++ b/android/scripts/generate-pngs.sh
@@ -46,11 +46,12 @@ function convert_image() {
local source_image="$1"
local dpi_config="$2"
+ local destination_image
if (( $# >= 3 )); then
- local destination_image="$3"
+ destination_image="$3"
else
- local destination_image="$(basename "$source_image" .svg | sed -e 's/-/_/g')"
+ destination_image="$(basename "$source_image" .svg | sed -e 's/-/_/g')"
fi
if (( $# >= 4 )); then
@@ -59,8 +60,10 @@ function convert_image() {
local destination_dir="drawable"
fi
- local dpi="$(echo "$dpi_config" | cut -f1 -d'-')"
- local size="$(echo "$dpi_config" | cut -f2 -d'-')"
+ local dpi
+ dpi="$(echo "$dpi_config" | cut -f1 -d'-')"
+ local size
+ size="$(echo "$dpi_config" | cut -f2 -d'-')"
local dpi_dir="../lib/resource/src/main/res/${destination_dir}-${dpi}"
diff --git a/android/scripts/run-instrumented-tests-locally.sh b/android/scripts/run-instrumented-tests-locally.sh
index 359c648d30..4a642356eb 100755
--- a/android/scripts/run-instrumented-tests-locally.sh
+++ b/android/scripts/run-instrumented-tests-locally.sh
@@ -4,7 +4,7 @@ set -eu
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd $SCRIPT_DIR/..
+cd "$SCRIPT_DIR"/..
./gradlew assembleOssProdAndroidTest
./gradlew app:assembleOssProdDebug
-$SCRIPT_DIR/run-instrumented-tests.sh app
+"$SCRIPT_DIR"/run-instrumented-tests.sh app
diff --git a/android/scripts/run-instrumented-tests.sh b/android/scripts/run-instrumented-tests.sh
index 5e3320533f..e72d4687bd 100755
--- a/android/scripts/run-instrumented-tests.sh
+++ b/android/scripts/run-instrumented-tests.sh
@@ -23,7 +23,7 @@ INVALID_TEST_ACCOUNT_TOKEN="${INVALID_TEST_ACCOUNT_TOKEN:-}"
while [[ "$#" -gt 0 ]]; do
case $1 in
--test-type)
- if [[ ! -z ${2-} && "$2" =~ ^(app|mockapi|e2e)$ ]]; then
+ if [[ -n "${2-}" && "$2" =~ ^(app|mockapi|e2e)$ ]]; then
TEST_TYPE="$2"
else
echo "Error: Bad or missing test type. Must be one of: app, mockapi, e2e"
@@ -32,7 +32,7 @@ while [[ "$#" -gt 0 ]]; do
shift 2
;;
--infra-flavor)
- if [[ ! -z ${2-} && "$2" =~ ^(prod|stagemole)$ ]]; then
+ if [[ -n "${2-}" && "$2" =~ ^(prod|stagemole)$ ]]; then
INFRA_FLAVOR="$2"
else
echo "Error: Bad or missing infra flavor. Must be one of: prod, stagemole"
@@ -41,7 +41,7 @@ while [[ "$#" -gt 0 ]]; do
shift 2
;;
--billing-flavor)
- if [[ ! -z ${2-} && "$2" =~ ^(oss|play)$ ]]; then
+ if [[ -n "${2-}" && "$2" =~ ^(oss|play)$ ]]; then
BILLING_FLAVOR="$2"
else
echo "Error: Bad or missing billing flavor. Must be one of: oss, play"