Skip to content

Commit

Permalink
SC2155
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 committed Jan 29, 2024
1 parent 6e8cd51 commit a73dc6e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
11 changes: 7 additions & 4 deletions android/scripts/generate-pngs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"

Expand Down
3 changes: 2 additions & 1 deletion ci/ios/buildserver-build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ function run_build_loop() {
run_git tag | xargs git tag -d > /dev/null

run_git fetch --prune --tags 2> /dev/null || continue
local tags=( $(run_git tag | grep "$TAG_PATTERN_TO_BUILD") )
local tags
tags=( $(run_git tag | grep "$TAG_PATTERN_TO_BUILD") )

for tag in "${tags[@]}"; do
build_ref "refs/tags/$tag"
Expand Down
3 changes: 2 additions & 1 deletion ci/verify-locked-down-signatures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -eu
shopt -s nullglob

readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
readonly SCRIPT_DIR
readonly REPO_DIR="$SCRIPT_DIR/.."

# In the CI environment we would like to import trusted public keys from a file,
Expand Down
3 changes: 2 additions & 1 deletion ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ install_mobile_provisioning() {
fi

for mobile_provisioning_path in "$IOS_PROVISIONING_PROFILES_DIR"/*.mobileprovision; do
local profile_uuid=$(get_mobile_provisioning_uuid "$mobile_provisioning_path")
local profile_uuid
profile_uuid=$(get_mobile_provisioning_uuid "$mobile_provisioning_path")
local target_path="$SYSTEM_PROVISIONING_PROFILES_DIR/$profile_uuid.mobileprovision"

if [[ -f "$target_path" ]]; then
Expand Down
12 changes: 8 additions & 4 deletions test/ci-runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ function download_app_package {
package_repo="${BUILD_RELEASE_REPOSITORY}"
fi

local filename=$(get_app_filename "$version" "$os")
local filename
filename=$(get_app_filename "$version" "$os")
local url="${package_repo}/$version/$filename"

mkdir -p "$PACKAGES_DIR"
Expand Down Expand Up @@ -170,7 +171,8 @@ function download_e2e_executable {
package_repo="${BUILD_RELEASE_REPOSITORY}"
fi

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

mkdir -p "$PACKAGES_DIR"
Expand All @@ -185,8 +187,10 @@ function download_e2e_executable {
function run_tests_for_os {
local os=$1

local prev_filename=$(get_app_filename "$OLD_APP_VERSION" "$os")
local cur_filename=$(get_app_filename "$NEW_APP_VERSION" "$os")
local prev_filename
prev_filename=$(get_app_filename "$OLD_APP_VERSION" "$os")
local cur_filename
cur_filename=$(get_app_filename "$NEW_APP_VERSION" "$os")

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

Expand Down
15 changes: 10 additions & 5 deletions wireguard/build-wireguard-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ function is_docker_build {
}

function unix_target_triple {
local platform="$(uname -s)"
local platform
platform="$(uname -s)"
if [[ ("${platform}" == "Linux") ]]; then
local arch="$(uname -m)"
local arch
arch="$(uname -m)"
echo "${arch}-unknown-linux-gnu"
elif [[ ("${platform}" == "Darwin") ]]; then
local arch="$(uname -m)"
local arch
arch="$(uname -m)"
if [[ ("${arch}" == "arm64") ]]; then
arch="aarch64"
fi
Expand Down Expand Up @@ -68,7 +71,8 @@ function build_unix {
export GOARCH=arm64
fi

export CC="$(xcrun -sdk "$SDKROOT" --find clang) -arch $arch -isysroot $SDKROOT"
CC="$(xcrun -sdk "$SDKROOT" --find clang) -arch $arch -isysroot $SDKROOT"
export CC
export CFLAGS="-isysroot $SDKROOT -arch $arch -I$SDKROOT/usr/include"
export LD_LIBRARY_PATH="$SDKROOT/usr/lib"
export CGO_CFLAGS="-isysroot $SDKROOT -arch $arch"
Expand Down Expand Up @@ -100,7 +104,8 @@ function build_wireguard_go {
return
fi

local platform="$(uname -s)";
local platform
platform="$(uname -s)";
case "$platform" in
Linux*|Darwin*) build_unix "${1:-$(unix_target_triple)}";;
*)
Expand Down

0 comments on commit a73dc6e

Please sign in to comment.