From cb80bf33e8bffc44b61dbe5ac36512bb93056719 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 9 Nov 2023 22:47:41 +0100 Subject: [PATCH] shellcheck --- contrib/msi/README.md | 4 ++-- contrib/msi/build.sh | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/contrib/msi/README.md b/contrib/msi/README.md index cdf1c355..b8585e1f 100644 --- a/contrib/msi/README.md +++ b/contrib/msi/README.md @@ -2,12 +2,12 @@ ## Docker test image for building an MSI locally -``` +```sh docker build . -f Dockerfile -t ubuntu:dnscrypt-msi ``` ## Test building msi files for intel win32 & win64 -``` +```sh ./build.sh ``` diff --git a/contrib/msi/build.sh b/contrib/msi/build.sh index ee9ff0bb..742782e9 100755 --- a/contrib/msi/build.sh +++ b/contrib/msi/build.sh @@ -1,29 +1,30 @@ -#!/bin/bash +#! /bin/sh version=0.0.0 gitver=$(git describe --tags --always --match="[0-9]*.[0-9]*.[0-9]*" --exclude='*[^0-9.]*') -if [[ "$gitver" != "" ]]; then - version=$gitver +if [ "$gitver" != "" ]; then + version=$gitver fi # build the image by running: docker build . -f Dockerfile -t ubuntu:dnscrypt-msi -if [[ "$(docker image list -q ubuntu:dnscrypt-msi)" == "" ]]; then +if [ "$(docker image list -q ubuntu:dnscrypt-msi)" = "" ]; then docker build . -f Dockerfile -t ubuntu:dnscrypt-msi fi image=ubuntu:dnscrypt-msi - -for arch in x64 x86 -do +for arch in x64 x86; do binpath="win32" - if [[ "$arch" == "x64" ]]; then + if [ "$arch" = "x64" ]; then binpath="win64" fi - src=$(cd ../../dnscrypt-proxy/$binpath; pwd) - echo $src + src=$( + cd ../../dnscrypt-proxy/$binpath || exit + pwd + ) + echo "$src" - docker run --rm -v $(pwd):/wixproj -v $src:/src $image wine candle.exe -dVersion=$version -dPlatform=$arch -dPath=\\src -arch $arch \\wixproj\\dnscrypt.wxs -out \\wixproj\\dnscrypt-$arch.wixobj - docker run --rm -v $(pwd):/wixproj -v $src:/src $image wine light.exe -out \\wixproj\\dnscrypt-proxy-$arch-$version.msi \\wixproj\\dnscrypt-$arch.wixobj -sval + docker run --rm -v "$(pwd)":/wixproj -v "$src":/src $image wine candle.exe -dVersion="$version" -dPlatform=$arch -dPath=\\src -arch $arch \\wixproj\\dnscrypt.wxs -out \\wixproj\\dnscrypt-$arch.wixobj + docker run --rm -v "$(pwd)":/wixproj -v "$src":/src $image wine light.exe -out \\wixproj\\dnscrypt-proxy-$arch-"$version".msi \\wixproj\\dnscrypt-$arch.wixobj -sval done