tools: remove bashisms from macOS release scripts · nodejs/node@a033910 · GitHub
Skip to content

Commit a033910

Browse files
aduh95targos
authored andcommitted
tools: remove bashisms from macOS release scripts
PR-URL: #36121 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 9434bb3 commit a033910

4 files changed

Lines changed: 21 additions & 20 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions

tools/osx-codesign.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
set -x
44
set -e
55

6-
if [ "X$SIGN" == "X" ]; then
7-
echo "No SIGN environment var. Skipping codesign." >&2
6+
# shellcheck disable=SC2154
7+
[ -z "$SIGN" ] && \
8+
echo "No SIGN environment var. Skipping codesign." >&2 && \
89
exit 0
9-
fi
1010

1111
# All macOS executable binaries in the bundle must be codesigned with the
1212
# hardened runtime enabled.
1313
# See https://github.com/nodejs/node/pull/31459
1414

15+
# shellcheck disable=SC2154
1516
codesign \
1617
--sign "$SIGN" \
1718
--entitlements tools/osx-entitlements.plist \

tools/osx-notarize.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# Uses gon, from https://github.com/mitchellh/gon, to notarize a generated node-<version>.pkg file
44
# with Apple for installation on macOS Catalina and later as validated by Gatekeeper.
@@ -8,18 +8,16 @@ set -e
88
gon_version="0.2.2"
99
gon_exe="${HOME}/.gon/gon_${gon_version}"
1010

11-
__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1211
pkgid="$1"
1312

14-
if [ "X${pkgid}" == "X" ]; then
15-
echo "Usage: $0 <pkgid>"
13+
[ -z "$pkgid" ] && \
14+
echo "Usage: $0 <pkgid>" \
1615
exit 1
17-
fi
1816

19-
if [ "X$NOTARIZATION_ID" == "X" ]; then
20-
echo "No NOTARIZATION_ID environment var. Skipping notarization."
17+
# shellcheck disable=SC2154
18+
[ -z "$NOTARIZATION_ID" ] && \
19+
echo "No NOTARIZATION_ID environment var. Skipping notarization." \
2120
exit 0
22-
fi
2321

2422
set -x
2523

tools/osx-productsign.sh

Lines changed: 6 additions & 4 deletions

0 commit comments

Comments
 (0)