From 3c400fb5468eaecbb1573ef21f8945fc05e48f55 Mon Sep 17 00:00:00 2001 From: nolen777 Date: Sat, 2 Oct 2021 09:20:37 -0700 Subject: [PATCH] use newer bash (#977) * use env bash instead of /bin/bash * check for variable existence Former-commit-id: 25a00ebffec9ba8c820be29c9adfd0a4c0f9cb29 --- ci/bazel_test.sh | 2 +- ci/build_eagle_installer_win.sh | 2 +- ci/build_servers.sh | 2 +- ci/build_unity_clients.sh | 2 +- ci/deploy_servers.sh | 2 +- ci/push_assets.sh | 2 +- ci/push_linux_exe.sh | 2 +- ci/push_mac_exe.sh | 2 +- ci/push_notarized_mac_exe.sh | 2 +- ci/push_win_exe.sh | 2 +- scripts/add_setting.sh | 2 +- scripts/codesign.sh | 2 +- scripts/dlSettings.sh | 2 +- scripts/downloadTsvs.sh | 2 +- scripts/format-csharp.sh | 2 +- scripts/install_grpc_unity3d_plugins.sh | 10 +++++----- scripts/install_grpc_unity_dlls.sh | 11 +++++------ scripts/update_dependencies.sh | 3 ++- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ci/bazel_test.sh b/ci/bazel_test.sh index d6f957755f..9c515d8835 100755 --- a/ci/bazel_test.sh +++ b/ci/bazel_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/ci/build_eagle_installer_win.sh b/ci/build_eagle_installer_win.sh index 93a896a256..ed14cf2ec0 100755 --- a/ci/build_eagle_installer_win.sh +++ b/ci/build_eagle_installer_win.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash /bin/mkdir -p win_output /usr/bin/dotnet publish src/main/csharp/net/eagle0/clients/win/installer/EagleInstaller.sln -o win_output diff --git a/ci/build_servers.sh b/ci/build_servers.sh index ee969b3fb8..367d6b233f 100755 --- a/ci/build_servers.sh +++ b/ci/build_servers.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/ci/build_unity_clients.sh b/ci/build_unity_clients.sh index a3b5763be0..cb8ff7ca6e 100755 --- a/ci/build_unity_clients.sh +++ b/ci/build_unity_clients.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euxo pipefail diff --git a/ci/deploy_servers.sh b/ci/deploy_servers.sh index c63bcabf87..affe15cc88 100755 --- a/ci/deploy_servers.sh +++ b/ci/deploy_servers.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/ci/push_assets.sh b/ci/push_assets.sh index a87792d87b..102c15a30e 100755 --- a/ci/push_assets.sh +++ b/ci/push_assets.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SSH_KEY_FILE=$1 SSH_USER_NAME=$2 diff --git a/ci/push_linux_exe.sh b/ci/push_linux_exe.sh index da71de2025..5c0d836d91 100755 --- a/ci/push_linux_exe.sh +++ b/ci/push_linux_exe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash /bin/echo "Zipping" /bin/tar --use-compress-program="/usr/bin/pigz" -cf ./eagle0linux/eagle0_linux.tar.gz ./eagle0linux/eagle0 diff --git a/ci/push_mac_exe.sh b/ci/push_mac_exe.sh index 5b866f2d32..e1187a3a9e 100755 --- a/ci/push_mac_exe.sh +++ b/ci/push_mac_exe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash /bin/echo "Zipping" /bin/tar --use-compress-program="/usr/bin/pigz" -cf ./eagle0mac/eagle0_mac.tar.gz ./eagle0mac/eagle0.app diff --git a/ci/push_notarized_mac_exe.sh b/ci/push_notarized_mac_exe.sh index df13194d78..64ac213d21 100755 --- a/ci/push_notarized_mac_exe.sh +++ b/ci/push_notarized_mac_exe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euxo pipefail diff --git a/ci/push_win_exe.sh b/ci/push_win_exe.sh index a8647c64ca..3f4a7d53fe 100755 --- a/ci/push_win_exe.sh +++ b/ci/push_win_exe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/scripts/add_setting.sh b/scripts/add_setting.sh index aaac2f7704..6a2265ec42 100755 --- a/scripts/add_setting.sh +++ b/scripts/add_setting.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash KEY=$1 VALUE=$2 diff --git a/scripts/codesign.sh b/scripts/codesign.sh index d3731f7645..961524e051 100644 --- a/scripts/codesign.sh +++ b/scripts/codesign.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash /usr/bin/security/security unlock-keychain development.keychain /usr/bin/codesign/codesign --deep --force --verify --verbose --timestamp --options runtime --sign "Apple Development: Daniel Crosby (AJ28LCLQQ8)" $1 diff --git a/scripts/dlSettings.sh b/scripts/dlSettings.sh index 18c0e7ea16..38b0b845ee 100755 --- a/scripts/dlSettings.sh +++ b/scripts/dlSettings.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash curl -L "https://docs.google.com/spreadsheets/d/1pv-WMXReccddPwev_YG9IXEGznuGHrYjNNEZ0Rb-ZhM/export?gid=0&format=tsv" > src/main/resources/net/eagle0/shardok/settings.tsv curl -L "https://docs.google.com/spreadsheets/d/1p6I5nUMcoAPHIcqikVgbBCFVnqN9dpOEVClbS_wOI7M/export?gid=0&format=tsv" > src/main/resources/net/eagle0/eagle/settings.tsv diff --git a/scripts/downloadTsvs.sh b/scripts/downloadTsvs.sh index 2b5dc538f7..23fc3836d0 100755 --- a/scripts/downloadTsvs.sh +++ b/scripts/downloadTsvs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash curl -L "https://docs.google.com/spreadsheets/d/1DHEsiv4cY4gE6AX3sVH82K__mpBD1aznIYCQwQxA_F0/export?gid=0&format=tsv" > src/main/resources/net/eagle0/names.tsv curl -L "https://docs.google.com/spreadsheets/d/1NhvG73HKyVE36yGpkV2oJiSIXoNqQOYTr5ArLnucYL0/export?gid=0&format=tsv" > src/main/resources/net/eagle0/shardok/battalionTypes.tsv diff --git a/scripts/format-csharp.sh b/scripts/format-csharp.sh index ce25fe9e4e..85ddc4f370 100644 --- a/scripts/format-csharp.sh +++ b/scripts/format-csharp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash dotnet-format ./src/main/csharp/net/eagle0/clients/unity/eagle0/eagle0.sln --exclude Assets/Plugins/SimpleFileBrowser Assets/Modern\ UI\ Pack Assets/Terrain\ Hexes Assets/Plugins/AsyncAwaitUtil Assets/GUI\ Pro\ Kit\ Fantasy\ RPG dotnet-format ./src/main/csharp/net/eagle0/clients/unity/eagle0/Assembly-CSharp.sln --exclude Assets/Plugins/SimpleFileBrowser Assets/Modern\ UI\ Pack Assets/Terrain\ Hexes Assets/Plugins/AsyncAwaitUtil Assets/GUI\ Pro\ Kit\ Fantasy\ RPG diff --git a/scripts/install_grpc_unity3d_plugins.sh b/scripts/install_grpc_unity3d_plugins.sh index ae5c8d584f..264a03d499 100755 --- a/scripts/install_grpc_unity3d_plugins.sh +++ b/scripts/install_grpc_unity3d_plugins.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash -set -euxo pipefail +set -exo pipefail -BAZEL="bazel --output_base=${BAZEL_OUTPUT_BASE}" - -if [ -z $BAZEL_OUTPUT_BASE ]; then +if [[ -n "$BAZEL_OUTPUT_BASE" ]]; then + BAZEL="bazel --output_base=${BAZEL_OUTPUT_BASE}" +else echo "no output base set, defaulting to off" BAZEL="bazel" fi diff --git a/scripts/install_grpc_unity_dlls.sh b/scripts/install_grpc_unity_dlls.sh index a8c8844562..9b941bc784 100755 --- a/scripts/install_grpc_unity_dlls.sh +++ b/scripts/install_grpc_unity_dlls.sh @@ -1,11 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash -set -e -set -x +set -exo pipefail -BAZEL="bazel --output_base=${BAZEL_OUTPUT_BASE}" - -if [ -z $BAZEL_OUTPUT_BASE ]; then +if [[ -n "$BAZEL_OUTPUT_BASE" ]]; then + BAZEL="bazel --output_base=${BAZEL_OUTPUT_BASE}" +else echo "no output base set, defaulting to off" BAZEL="bazel" fi diff --git a/scripts/update_dependencies.sh b/scripts/update_dependencies.sh index 1680abff99..82429be8e1 100755 --- a/scripts/update_dependencies.sh +++ b/scripts/update_dependencies.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + echo -ne "\033[0;32m" echo 'Updating bazel dependencies. This will take about five minutes.' echo -ne "\033[0m"