-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: remove bashisms from macOS release scripts #36121
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than this disable directive, would it be better to add a Or is that a modification outside the scope of this PR and should be done later? |
||
codesign \ | ||
--sign "$SIGN" \ | ||
--entitlements tools/osx-entitlements.plist \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this directive is necessary? |
||
[ -z "$NOTARIZATION_ID" ] && \ | ||
echo "No NOTARIZATION_ID environment var. Skipping notarization." \ | ||
exit 0 | ||
fi | ||
|
||
set -x | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this directive is necessary? |
||
[ -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 | ||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of these two disable directives, would it make sense to add a |
||
mv "$PKG"-SIGNED "$PKG" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this disable directive is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting this warning when I remove this line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using ShellCheck 0.7.1 btw, that may be a version-specific behavior.