diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-01-25 11:44:41 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-02-02 11:04:48 +0100 |
| commit | b6e0545e1b5ae2fbcb6655bd4d28739cf9f943d6 (patch) | |
| tree | 40644f1100793192c23fd7491978dc26ad1fef97 /gui/scripts | |
| parent | 1438e369b10bbf50900d9e380329001513de2c1e (diff) | |
| download | mullvadvpn-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 'gui/scripts')
| -rwxr-xr-x | gui/scripts/build-logo-icons.sh | 28 | ||||
| -rwxr-xr-x | gui/scripts/build-proto.sh | 6 | ||||
| -rwxr-xr-x | gui/scripts/crowdin.sh | 8 |
3 files changed, 21 insertions, 21 deletions
diff --git a/gui/scripts/build-logo-icons.sh b/gui/scripts/build-logo-icons.sh index a1e30dd18b..e35f713e77 100755 --- a/gui/scripts/build-logo-icons.sh +++ b/gui/scripts/build-logo-icons.sh @@ -46,8 +46,8 @@ TMP_DIR=$(mktemp -d) TMP_ICO_DIR="$TMP_DIR/ico" TMP_ICONSET_DIR="$TMP_DIR/icon.iconset" -mkdir $TMP_ICONSET_DIR -mkdir $TMP_ICO_DIR +mkdir "$TMP_ICONSET_DIR" +mkdir "$TMP_ICO_DIR" COMPRESSION_OPTIONS="-define png:compression-filter=5 -define png:compression-level=9 \ -define png:compression-strategy=1 -define png:exclude-chunk=all -strip" @@ -62,30 +62,30 @@ rm "$TMP_ICONSET_DIR"/* # Linux .icns icon for size in 16 32 128 256 512; do - double_size=$[$size * 2] - rsvg-convert -o $TMP_ICONSET_DIR/icon-$size.png -w $size -h $size $SVG_SOURCE_PATH - rsvg-convert -o $TMP_ICONSET_DIR/icon-$size@2x.png -w $double_size -h $double_size \ + double_size="$((size * 2))" + rsvg-convert -o "$TMP_ICONSET_DIR"/icon-$size.png -w $size -h $size $SVG_SOURCE_PATH + rsvg-convert -o "$TMP_ICONSET_DIR"/icon-$size@2x.png -w "$double_size" -h "$double_size" \ $SVG_SOURCE_PATH done -iconutil --convert icns --output $DIST_ASSETS_DIR/icon.icns $TMP_ICONSET_DIR -rm -rf $TMP_ICONSET_DIR +iconutil --convert icns --output $DIST_ASSETS_DIR/icon.icns "$TMP_ICONSET_DIR" +rm -rf "$TMP_ICONSET_DIR" # Windows .ico icon for size in 16 20 24 30 32 36 40 48 60 64 72 80 96 256 512; do - rsvg-convert -o $TMP_ICO_DIR/$size.png -w $size -h $size $SVG_SOURCE_PATH + rsvg-convert -o "$TMP_ICO_DIR"/$size.png -w $size -h $size $SVG_SOURCE_PATH done -convert $TMP_ICO_DIR/* $COMPRESSION_OPTIONS $DIST_ASSETS_DIR/icon.ico -rm -rf $TMP_ICO_DIR +convert "$TMP_ICO_DIR"/* "$COMPRESSION_OPTIONS" $DIST_ASSETS_DIR/icon.ico +rm -rf "$TMP_ICO_DIR" # Windows installer sidebar # "bmp3" specifies the Windows 3.x format which is required for the image to be displayed sidebar_path="$TMP_DIR/sidebar.png" sidebar_logo_size=234 -rsvg-convert -o $sidebar_path -w $sidebar_logo_size -h $sidebar_logo_size $SVG_SOURCE_PATH -convert -background "#294D73" $sidebar_path \ +rsvg-convert -o "$sidebar_path" -w $sidebar_logo_size -h $sidebar_logo_size $SVG_SOURCE_PATH +convert -background "#294D73" "$sidebar_path" \ -gravity center -extent ${sidebar_logo_size}x314 \ -gravity west -crop 164x314+10+0 bmp3:$DIST_ASSETS_DIR/windows/installersidebar.bmp -rm $sidebar_path +rm "$sidebar_path" # GUI notification icon rsvg-convert -o ../assets/images/icon-notification.png -w 128 -h 128 $SVG_SOURCE_PATH @@ -93,5 +93,5 @@ rsvg-convert -o ../assets/images/icon-notification.png -w 128 -h 128 $SVG_SOURCE # GUI in app icon cp "$SVG_SOURCE_PATH" ../assets/images/logo-icon.svg -rmdir $TMP_DIR +rmdir "$TMP_DIR" diff --git a/gui/scripts/build-proto.sh b/gui/scripts/build-proto.sh index 7cb0d989c4..8861eb5730 100755 --- a/gui/scripts/build-proto.sh +++ b/gui/scripts/build-proto.sh @@ -24,8 +24,8 @@ mkdir -p $TYPES_DESTINATION_DIR if [[ "$PLATFORM" == "Linux" && ("${ARCH,,}" == "arm64" || "${ARCH,,}" == "aarch64") ]]; then if [[ -n "${MANAGEMENT_INTERFACE_PROTO_BUILD_DIR}" ]]; then - cp $MANAGEMENT_INTERFACE_PROTO_BUILD_DIR/*.js $DESTINATION_DIR - cp $MANAGEMENT_INTERFACE_PROTO_BUILD_DIR/*.ts $TYPES_DESTINATION_DIR + cp "$MANAGEMENT_INTERFACE_PROTO_BUILD_DIR"/*.js $DESTINATION_DIR + cp "$MANAGEMENT_INTERFACE_PROTO_BUILD_DIR"/*.ts $TYPES_DESTINATION_DIR else >&2 echo "Building management interface proto files on aarch64 is not supported" >&2 echo "(see https://github.com/grpc/grpc-node/issues/1497)." @@ -41,7 +41,7 @@ else $PROTO_DIR/$PROTO_FILENAME "$NODE_MODULES_DIR/grpc_tools_node_protoc" \ - --plugin=protoc-gen-ts=$TS_PROTOC_PLUGIN \ + --plugin=protoc-gen-ts="$TS_PROTOC_PLUGIN" \ --ts_out=grpc_js:$TYPES_DESTINATION_DIR \ --proto_path=$PROTO_DIR \ $PROTO_DIR/$PROTO_FILENAME diff --git a/gui/scripts/crowdin.sh b/gui/scripts/crowdin.sh index 466f643c75..74f324bfd2 100755 --- a/gui/scripts/crowdin.sh +++ b/gui/scripts/crowdin.sh @@ -3,7 +3,7 @@ set -e BASE_URL=https://api.crowdin.com/api/project/mullvad-app SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=$( dirname $SCRIPT_DIR ) +ROOT_DIR=$( dirname "$SCRIPT_DIR" ) LOCALE_DIR="$ROOT_DIR/locales" if [ $# -ne 1 ]; then @@ -32,9 +32,9 @@ function download_translations { wget \ --content-disposition \ $BASE_URL/download/all.zip?key="$CROWDIN_API_KEY" - unzip -o all.zip -d $LOCALE_DIR - find $LOCALE_DIR -type d -exec chmod 755 {} \; - find $LOCALE_DIR -type f -exec chmod 644 {} \; + unzip -o all.zip -d "$LOCALE_DIR" + find "$LOCALE_DIR" -type d -exec chmod 755 {} \; + find "$LOCALE_DIR" -type f -exec chmod 644 {} \; rm all.zip } |
