Skip to content
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

Fix errors in documentation #476

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/tutorials/sigstore-keyless.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ While it might be fun for some to do this manually (I'm looking at you VIM power
cat << 'EOF' > template-policy.sh

email="$1"
fulcio_root="$(cat fulcio.pem | jq -r '.chains.[0].certificates.[0]')"
fulcio_int="$(cat fulcio.pem | jq -r '.chains.[0].certificates.[1]')"
fulcio_root="$(cat fulcio.pem | jq -r '.chains[0].certificates[0]')"
fulcio_int="$(cat fulcio.pem | jq -r '.chains[0].certificates[1]')"
freetsa_root="$(cat freetsa.pem)"
fulcio_root_b64="$(echo "$fulcio_root" | openssl base64 -A)"
fulcio_int_b64="$(echo "$fulcio_int" | openssl base64 -A)"
Expand All @@ -226,10 +226,10 @@ freetsa_root_b64="$(echo "$freetsa_root" | openssl base64 -A)"
cp policy-template.json policy.json

# Use double quotes around variables in sed commands to preserve newlines
sed -i '' "s|{{FULCIO_ROOT}}|$fulcio_root_b64|g" policy.json
sed -i '' "s|{{FULCIO_INT}}|$fulcio_int_b64|g" policy.json
sed -i '' "s|{{FREETSA_ROOT}}|$freetsa_root_b64|g" policy.json
sed -i '' "s|{{EMAIL}}|$email|g" policy.json
sed -i "s|{{FULCIO_ROOT}}|$fulcio_root_b64|g" policy.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the '' I'm getting this error on my Apple silicon Mac:

sed: 1: "policy.json": extra characters at the end of p command

What OS and shell program are you using?

sed -i "s|{{FULCIO_INT}}|$fulcio_int_b64|g" policy.json
sed -i "s|{{FREETSA_ROOT}}|$freetsa_root_b64|g" policy.json
sed -i "s|{{EMAIL}}|$email|g" policy.json

# Calculate SHA256 hash (macOS and Linux compatible)
if [[ "$(uname)" == "Darwin" ]]; then
Expand Down
Loading