From 897307554a6391035566731b9755458dda04e32f Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 14 Nov 2020 18:30:45 +0100 Subject: tools: remove bashisms from macOS release scripts PR-URL: https://github.com/nodejs/node/pull/36121 Reviewed-By: Rich Trott --- tools/osx-codesign.sh | 9 +++++---- tools/osx-notarize.sh | 14 ++++++-------- tools/osx-productsign.sh | 10 ++++++---- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'tools') diff --git a/tools/osx-codesign.sh b/tools/osx-codesign.sh index 7ca80ca7462..346afdbe66e 100644 --- a/tools/osx-codesign.sh +++ b/tools/osx-codesign.sh @@ -1,17 +1,18 @@ -#!/bin/bash +#!/bin/sh set -x set -e -if [ "X$SIGN" == "X" ]; then - echo "No SIGN environment var. Skipping codesign." >&2 +# shellcheck disable=SC2154 +[ -z "$SIGN" ] && \ + echo "No SIGN environment var. Skipping codesign." >&2 && \ exit 0 -fi # All macOS executable binaries in the bundle must be codesigned with the # hardened runtime enabled. # See https://github.com/nodejs/node/pull/31459 +# shellcheck disable=SC2154 codesign \ --sign "$SIGN" \ --entitlements tools/osx-entitlements.plist \ diff --git a/tools/osx-notarize.sh b/tools/osx-notarize.sh index 97bb0912722..07d3e20e7e9 100755 --- a/tools/osx-notarize.sh +++ b/tools/osx-notarize.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Uses gon, from https://github.com/mitchellh/gon, to notarize a generated node-.pkg file # with Apple for installation on macOS Catalina and later as validated by Gatekeeper. @@ -8,18 +8,16 @@ set -e gon_version="0.2.2" gon_exe="${HOME}/.gon/gon_${gon_version}" -__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" pkgid="$1" -if [ "X${pkgid}" == "X" ]; then - echo "Usage: $0 " +[ -z "$pkgid" ] && \ + echo "Usage: $0 " \ exit 1 -fi -if [ "X$NOTARIZATION_ID" == "X" ]; then - echo "No NOTARIZATION_ID environment var. Skipping notarization." +# shellcheck disable=SC2154 +[ -z "$NOTARIZATION_ID" ] && \ + echo "No NOTARIZATION_ID environment var. Skipping notarization." \ exit 0 -fi set -x diff --git a/tools/osx-productsign.sh b/tools/osx-productsign.sh index 491e3fde62f..b1daedcf7ee 100644 --- a/tools/osx-productsign.sh +++ b/tools/osx-productsign.sh @@ -1,12 +1,14 @@ -#!/bin/bash +#!/bin/sh set -x set -e -if [ "X$SIGN" == "X" ]; then - echo "No SIGN environment var. Skipping codesign." >&2 +# shellcheck disable=SC2154 +[ -z "$SIGN" ] && \ + echo "No SIGN environment var. Skipping codesign." >&2 && \ exit 0 -fi +# shellcheck disable=SC2154 productsign --sign "$SIGN" "$PKG" "$PKG"-SIGNED +# shellcheck disable=SC2154 mv "$PKG"-SIGNED "$PKG" -- cgit v1.2.3