GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: remove bashisms from macOS release scripts · nodejs/node@a033910

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Makefile
  • tools
    • osx-codesign.sh
    • osx-notarize.sh
    • osx-productsign.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ $(PKG): release-only
978978
--release-urlbase=$(RELEASE_URLBASE) \
979979
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
980980
$(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/node
981-
SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" bash \
981+
SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" sh \
982982
tools/osx-codesign.sh
983983
mkdir -p $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules
984984
mkdir -p $(MACOSOUTDIR)/pkgs
@@ -1000,8 +1000,8 @@ $(PKG): release-only
10001000
productbuild --distribution $(MACOSOUTDIR)/installer/productbuild/distribution.xml \
10011001
--resources $(MACOSOUTDIR)/installer/productbuild/Resources \
10021002
--package-path $(MACOSOUTDIR)/pkgs ./$(PKG)
1003-
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh
1004-
bash tools/osx-notarize.sh $(FULLVERSION)
1003+
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" sh tools/osx-productsign.sh
1004+
sh tools/osx-notarize.sh $(FULLVERSION)
10051005

10061006
.PHONY: pkg
10071007
# Builds the macOS installer for releases.
@@ -1119,7 +1119,7 @@ $(BINARYTAR): release-only
11191119
cp LICENSE $(BINARYNAME)
11201120
cp CHANGELOG.md $(BINARYNAME)
11211121
ifeq ($(OSTYPE),darwin)
1122-
SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" bash tools/osx-codesign.sh
1122+
SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" sh tools/osx-codesign.sh
11231123
endif
11241124
tar -cf $(BINARYNAME).tar $(BINARYNAME)
11251125
$(RM) -r $(BINARYNAME)
Collapse file

‎tools/osx-codesign.sh‎

Copy file name to clipboardExpand all lines: tools/osx-codesign.sh
+5-4Lines 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 \
Collapse file

‎tools/osx-notarize.sh‎

Copy file name to clipboardExpand all lines: tools/osx-notarize.sh
+6-8Lines 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

Collapse file

‎tools/osx-productsign.sh‎

Copy file name to clipboard
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
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

11+
# shellcheck disable=SC2154
1112
productsign --sign "$SIGN" "$PKG" "$PKG"-SIGNED
13+
# shellcheck disable=SC2154
1214
mv "$PKG"-SIGNED "$PKG"

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.