Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2020-11-14 20:30:45 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2020-12-05 01:56:13 +0300
commit897307554a6391035566731b9755458dda04e32f (patch)
tree0fec2fe2145e6bb7a83d60a424fb49035648eb48 /tools
parent1729ba7578483381bdf97e31a9f85c57aeb00fac (diff)
tools: remove bashisms from macOS release scripts
PR-URL: https://github.com/nodejs/node/pull/36121 Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/osx-codesign.sh9
-rwxr-xr-xtools/osx-notarize.sh14
-rw-r--r--tools/osx-productsign.sh10
3 files changed, 17 insertions, 16 deletions
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-<version>.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 <pkgid>"
+[ -z "$pkgid" ] && \
+ echo "Usage: $0 <pkgid>" \
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"