Skip to content

Commit 0319062

Browse files
committed
SC2086
1 parent 7788979 commit 0319062

7 files changed

+44
-44
lines changed

build-apk.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do
103103
esac
104104

105105
echo "Building mullvad-daemon for $TARGET"
106-
cargo build $CARGO_ARGS --target "$TARGET" --package mullvad-jni
106+
cargo build "$CARGO_ARGS" --target "$TARGET" --package mullvad-jni
107107

108108
STRIP_TOOL="${NDK_TOOLCHAIN_DIR}/llvm-strip"
109109
TARGET_LIB_PATH="$SCRIPT_DIR/android/app/build/extraJni/$ABI/libmullvad_jni.so"
@@ -117,7 +117,7 @@ for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do
117117
done
118118

119119
echo "Updating relays.json..."
120-
cargo run --bin relay_list $CARGO_ARGS > build/relays.json
120+
cargo run --bin relay_list "$CARGO_ARGS" > build/relays.json
121121

122122
cd "$SCRIPT_DIR/android"
123123
$GRADLE_CMD --console plain "${GRADLE_TASKS[@]}"

ci/ios/buildserver-build-ios.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export GIT_DIR="$GIT_WORK_TREE/.git"
1414
function run_git {
1515
# `git submodule` needs more info than just $GIT_DIR and $GIT_WORK_TREE.
1616
# But -C makes it work.
17-
git -C $GIT_WORK_TREE $@
17+
git -C "$GIT_WORK_TREE" $@
1818
}
1919

2020

@@ -43,7 +43,7 @@ function build_ref() {
4343
fi
4444

4545
run_git reset --hard
46-
run_git checkout $tag
46+
run_git checkout "$tag"
4747
run_git submodule update
4848
run_git clean -df
4949

gui/scripts/build-logo-icons.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ TMP_DIR=$(mktemp -d)
4646
TMP_ICO_DIR="$TMP_DIR/ico"
4747
TMP_ICONSET_DIR="$TMP_DIR/icon.iconset"
4848

49-
mkdir $TMP_ICONSET_DIR
50-
mkdir $TMP_ICO_DIR
49+
mkdir "$TMP_ICONSET_DIR"
50+
mkdir "$TMP_ICO_DIR"
5151

5252
COMPRESSION_OPTIONS="-define png:compression-filter=5 -define png:compression-level=9 \
5353
-define png:compression-strategy=1 -define png:exclude-chunk=all -strip"
@@ -62,36 +62,36 @@ rm "$TMP_ICONSET_DIR"/*
6262

6363
# Linux .icns icon
6464
for size in 16 32 128 256 512; do
65-
double_size=$[$size * 2]
66-
rsvg-convert -o $TMP_ICONSET_DIR/icon-$size.png -w $size -h $size $SVG_SOURCE_PATH
67-
rsvg-convert -o $TMP_ICONSET_DIR/icon-$size@2x.png -w $double_size -h $double_size \
65+
double_size="$[$size * 2]"
66+
rsvg-convert -o "$TMP_ICONSET_DIR"/icon-$size.png -w $size -h $size $SVG_SOURCE_PATH
67+
rsvg-convert -o "$TMP_ICONSET_DIR"/icon-$size@2x.png -w "$double_size" -h "$double_size" \
6868
$SVG_SOURCE_PATH
6969
done
70-
iconutil --convert icns --output $DIST_ASSETS_DIR/icon.icns $TMP_ICONSET_DIR
71-
rm -rf $TMP_ICONSET_DIR
70+
iconutil --convert icns --output $DIST_ASSETS_DIR/icon.icns "$TMP_ICONSET_DIR"
71+
rm -rf "$TMP_ICONSET_DIR"
7272

7373
# Windows .ico icon
7474
for size in 16 20 24 30 32 36 40 48 60 64 72 80 96 256 512; do
75-
rsvg-convert -o $TMP_ICO_DIR/$size.png -w $size -h $size $SVG_SOURCE_PATH
75+
rsvg-convert -o "$TMP_ICO_DIR"/$size.png -w $size -h $size $SVG_SOURCE_PATH
7676
done
77-
convert $TMP_ICO_DIR/* $COMPRESSION_OPTIONS $DIST_ASSETS_DIR/icon.ico
78-
rm -rf $TMP_ICO_DIR
77+
convert "$TMP_ICO_DIR"/* "$COMPRESSION_OPTIONS" $DIST_ASSETS_DIR/icon.ico
78+
rm -rf "$TMP_ICO_DIR"
7979

8080
# Windows installer sidebar
8181
# "bmp3" specifies the Windows 3.x format which is required for the image to be displayed
8282
sidebar_path="$TMP_DIR/sidebar.png"
8383
sidebar_logo_size=234
84-
rsvg-convert -o $sidebar_path -w $sidebar_logo_size -h $sidebar_logo_size $SVG_SOURCE_PATH
85-
convert -background "#294D73" $sidebar_path \
84+
rsvg-convert -o "$sidebar_path" -w $sidebar_logo_size -h $sidebar_logo_size $SVG_SOURCE_PATH
85+
convert -background "#294D73" "$sidebar_path" \
8686
-gravity center -extent ${sidebar_logo_size}x314 \
8787
-gravity west -crop 164x314+10+0 bmp3:$DIST_ASSETS_DIR/windows/installersidebar.bmp
88-
rm $sidebar_path
88+
rm "$sidebar_path"
8989

9090
# GUI notification icon
9191
rsvg-convert -o ../assets/images/icon-notification.png -w 128 -h 128 $SVG_SOURCE_PATH
9292

9393
# GUI in app icon
9494
cp "$SVG_SOURCE_PATH" ../assets/images/logo-icon.svg
9595

96-
rmdir $TMP_DIR
96+
rmdir "$TMP_DIR"
9797

gui/scripts/crowdin.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
BASE_URL=https://api.crowdin.com/api/project/mullvad-app
55
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6-
ROOT_DIR=$( dirname $SCRIPT_DIR )
6+
ROOT_DIR=$( dirname "$SCRIPT_DIR" )
77
LOCALE_DIR="$ROOT_DIR/locales"
88

99
if [ $# -ne 1 ]; then
@@ -32,9 +32,9 @@ function download_translations {
3232
wget \
3333
--content-disposition \
3434
$BASE_URL/download/all.zip?key="$CROWDIN_API_KEY"
35-
unzip -o all.zip -d $LOCALE_DIR
36-
find $LOCALE_DIR -type d -exec chmod 755 {} \;
37-
find $LOCALE_DIR -type f -exec chmod 644 {} \;
35+
unzip -o all.zip -d "$LOCALE_DIR"
36+
find "$LOCALE_DIR" -type d -exec chmod 755 {} \;
37+
find "$LOCALE_DIR" -type f -exec chmod 644 {} \;
3838
rm all.zip
3939
}
4040

ios/build-rust-library.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ for arch in $ARCHS; do
4343

4444
# Intel iOS simulator
4545
export CFLAGS_x86_64_apple_ios="-target x86_64-apple-ios"
46-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib $RELFLAG --target x86_64-apple-ios
47-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib --target x86_64-apple-ios
46+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib $RELFLAG --target x86_64-apple-ios
47+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib --target x86_64-apple-ios
4848
;;
4949

5050
arm64)
5151
if [ $IS_SIMULATOR -eq 0 ]; then
5252
# Hardware iOS targets
53-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib $RELFLAG --target aarch64-apple-ios
54-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib --target aarch64-apple-ios
53+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib $RELFLAG --target aarch64-apple-ios
54+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib --target aarch64-apple-ios
5555
else
56-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib $RELFLAG --target aarch64-apple-ios-sim
57-
$HOME/.cargo/bin/cargo build -p $FFI_TARGET --lib --target aarch64-apple-ios-sim
56+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib $RELFLAG --target aarch64-apple-ios-sim
57+
"$HOME"/.cargo/bin/cargo build -p "$FFI_TARGET" --lib --target aarch64-apple-ios-sim
5858
fi
5959
esac
6060
done

prepare-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fi
8585
if [[ "$DESKTOP" == "true" ]]; then
8686
echo "Tagging current git commit with release tag $PRODUCT_VERSION..."
8787

88-
git tag -s $PRODUCT_VERSION -m $PRODUCT_VERSION
88+
git tag -s "$PRODUCT_VERSION" -m "$PRODUCT_VERSION"
8989
NEW_TAGS+=" $PRODUCT_VERSION"
9090
fi
9191

test/ci-runtests.sh

+15-15
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function is_dev_version {
8282
function get_app_filename {
8383
local version=$1
8484
local os=$2
85-
if is_dev_version $version; then
85+
if is_dev_version "$version"; then
8686
# only save 6 chars of the hash
8787
local commit="${BASH_REMATCH[3]}"
8888
version="${BASH_REMATCH[1]}${commit}"
@@ -116,19 +116,19 @@ function download_app_package {
116116
local os=$2
117117
local package_repo=""
118118

119-
if is_dev_version $version; then
119+
if is_dev_version "$version"; then
120120
package_repo="${BUILD_DEV_REPOSITORY}"
121121
else
122122
package_repo="${BUILD_RELEASE_REPOSITORY}"
123123
fi
124124

125-
local filename=$(get_app_filename $version $os)
125+
local filename=$(get_app_filename "$version" "$os")
126126
local url="${package_repo}/$version/$filename"
127127

128128
mkdir -p "$PACKAGES_DIR"
129129
if [[ ! -f "$PACKAGES_DIR/$filename" ]]; then
130130
echo "Downloading build for $version ($os) from $url"
131-
curl -sf -o "$PACKAGES_DIR/$filename" $url
131+
curl -sf -o "$PACKAGES_DIR/$filename" "$url"
132132
else
133133
echo "Found build for $version ($os)"
134134
fi
@@ -137,7 +137,7 @@ function download_app_package {
137137
function get_e2e_filename {
138138
local version=$1
139139
local os=$2
140-
if is_dev_version $version; then
140+
if is_dev_version "$version"; then
141141
# only save 6 chars of the hash
142142
local commit="${BASH_REMATCH[3]}"
143143
version="${BASH_REMATCH[1]}${commit}"
@@ -164,19 +164,19 @@ function download_e2e_executable {
164164
local os=$2
165165
local package_repo=""
166166

167-
if is_dev_version $version; then
167+
if is_dev_version "$version"; then
168168
package_repo="${BUILD_DEV_REPOSITORY}"
169169
else
170170
package_repo="${BUILD_RELEASE_REPOSITORY}"
171171
fi
172172

173-
local filename=$(get_e2e_filename $version $os)
173+
local filename=$(get_e2e_filename "$version" "$os")
174174
local url="${package_repo}/$version/additional-files/$filename"
175175

176-
mkdir -p $PACKAGES_DIR
176+
mkdir -p "$PACKAGES_DIR"
177177
if [[ ! -f "$PACKAGES_DIR/$filename" ]]; then
178178
echo "Downloading e2e executable for $version ($os) from $url"
179-
curl -sf -o "$PACKAGES_DIR/$filename" $url
179+
curl -sf -o "$PACKAGES_DIR/$filename" "$url"
180180
else
181181
echo "Found e2e executable for $version ($os)"
182182
fi
@@ -185,8 +185,8 @@ function download_e2e_executable {
185185
function run_tests_for_os {
186186
local os=$1
187187

188-
local prev_filename=$(get_app_filename $OLD_APP_VERSION $os)
189-
local cur_filename=$(get_app_filename $NEW_APP_VERSION $os)
188+
local prev_filename=$(get_app_filename "$OLD_APP_VERSION" "$os")
189+
local cur_filename=$(get_app_filename "$NEW_APP_VERSION" "$os")
190190

191191
rm -f "$SCRIPT_DIR/.ci-logs/${os}_report"
192192

@@ -203,10 +203,10 @@ echo "**********************************"
203203
echo "* Downloading app packages"
204204
echo "**********************************"
205205

206-
mkdir -p $PACKAGES_DIR
207-
nice_time download_app_package $OLD_APP_VERSION $TEST_OS
208-
nice_time download_app_package $NEW_APP_VERSION $TEST_OS
209-
nice_time download_e2e_executable $NEW_APP_VERSION $TEST_OS
206+
mkdir -p "$PACKAGES_DIR"
207+
nice_time download_app_package "$OLD_APP_VERSION" "$TEST_OS"
208+
nice_time download_app_package "$NEW_APP_VERSION" "$TEST_OS"
209+
nice_time download_e2e_executable "$NEW_APP_VERSION" "$TEST_OS"
210210

211211
echo "**********************************"
212212
echo "* Building test runner"

0 commit comments

Comments
 (0)