From e0bbe21b214923b744a963108282c31f078a5a41 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 12 Sep 2023 11:59:10 +1000 Subject: [PATCH 1/2] export script_content so it is avaliable in process_file --- .gitlab/pipeline/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 328b37af1d4d..4932251aa9f2 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -111,6 +111,7 @@ build-rustdoc: sed -i "s||$script_content|" "$file" } export -f process_file + export script_content # Modify .html files in parallel using xargs, otherwise it can take a long time. find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {} From 6778c6482f3b1ac5fd917c1d15a23f595c58425d Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 12 Sep 2023 12:04:41 +1000 Subject: [PATCH 2/2] add comments --- .gitlab/pipeline/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 4932251aa9f2..924d648e3f98 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -111,6 +111,8 @@ build-rustdoc: sed -i "s||$script_content|" "$file" } export -f process_file + # xargs runs process_file in seperate shells without access to outer variables. + # to make script_content available inside process_file, export it as an env var here. export script_content # Modify .html files in parallel using xargs, otherwise it can take a long time.