Skip to content

Commit

Permalink
[CI] Ensure spec processing works even if path contains a space (#5422)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Oct 18, 2024
1 parent ebd4457 commit b3bf36e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions scripts/content-modules/adjust-pages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ ()
# Images
s|(\.\./)?internal(/img/[-\w]+\.png)|$2|g;
s|(\]\()(img/.*?\))|$1../$2|g if $ARGV !~ /(logs|schemas)._index/ && $ARGV !~ /otlp\/docs/;
s|(\]\()([^)]+\.png\))|$1../$2|g if $ARGV =~ /\/tmp\/semconv\/docs\/general\/attributes/;
s|(\]\()([^)]+\.png\))|$1../$2|g if $ARGV =~ /\/tmp\/semconv\/docs\/http\/http-spans/;
s|(\]\()([^)]+\.png\))|$1../$2|g if $ARGV =~ /\btmp\/semconv\/docs\/general\/attributes/;
s|(\]\()([^)]+\.png\))|$1../$2|g if $ARGV =~ /\btmp\/semconv\/docs\/http\/http-spans/;

s|\.\.\/README.md\b|$otelSpecRepoUrl/|g if $ARGV =~ /specification._index/;
s|\.\.\/README.md\b|..| if $ARGV =~ /specification.library-guidelines.md/;

s|\.\./(opentelemetry/proto/?.*)|$otlpSpecRepoUrl/tree/v$otlpSpecVers/$1|g if $ARGV =~ /\/tmp\/otlp/;
s|\.\./README.md\b|$otlpSpecRepoUrl/|g if $ARGV =~ /\/tmp\/otlp/;
s|\.\./examples/README.md\b|$otlpSpecRepoUrl/tree/v$otlpSpecVers/examples/|g if $ARGV =~ /\/tmp\/otlp/;
s|\.\./(opentelemetry/proto/?.*)|$otlpSpecRepoUrl/tree/v$otlpSpecVers/$1|g if $ARGV =~ /\btmp\/otlp/;
s|\.\./README.md\b|$otlpSpecRepoUrl/|g if $ARGV =~ /\btmp\/otlp/;
s|\.\./examples/README.md\b|$otlpSpecRepoUrl/tree/v$otlpSpecVers/examples/|g if $ARGV =~ /\btmp\/otlp/;

s|\bREADME.md\b|_index.md|g if $ARGV !~ /otel\/specification\/protocol\/_index.md/;

Expand All @@ -144,7 +144,7 @@ ()
s|(\.\.\/)+(supplementary-guidelines\/compatibility\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g;

# Rewrite inline links
if ($ARGV =~ /\/tmp\/opamp/) {
if ($ARGV =~ /\btmp\/opamp/) {
s|\]\(([^:\)]*?)\.md((#.*?)?)\)|]($1/$2)|g;
} else {
s|\]\(([^:\)]*?\.md(#.*?)?)\)|]({{% relref "$1" %}})|g;
Expand Down
4 changes: 2 additions & 2 deletions scripts/content-modules/cp-pages.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

SCRIPT_DIR="$(cd `dirname $0`; pwd)"
DEST_BASE="$(cd $SCRIPT_DIR; cd ../../; pwd)/tmp"
SCRIPT_DIR=$(dirname $0)
DEST_BASE=tmp

## OTel specification

Expand Down

0 comments on commit b3bf36e

Please sign in to comment.