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 combined_haddock.sh script #6199

Merged
merged 3 commits into from
Jun 10, 2024
Merged
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
10 changes: 5 additions & 5 deletions scripts/combined-haddock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rm -rf $DST
mkdir -p $DST

# List of target haskell packages
PACKAGE_DIRS=$(find $SRC -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | sed -E 's/-[0-9].*$//' | sort -u)
PACKAGE_NAMES=$(find $SRC -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | sed -E 's/-[0-9].*$//' | sort -u)

# Merge each package's sublibraries into a single folder, for example:
# Merge:
Expand All @@ -47,18 +47,18 @@ PACKAGE_DIRS=$(find $SRC -maxdepth 1 -mindepth 1 -type d -exec basename {} \; |
# Into:
# plutus-core/*
for NAME in $PACKAGE_NAMES; do
mkdir -p $DST/$NAME/src
SUBLIBS=$(find $SRC -type d -name "$NAME*" -print)
mkdir -p $DST/$NAME/src
for SUBLIB in $SUBLIBS; do
cp -R $SUBLIB/* $DST/$NAME
cp -R $SUBLIB/. $DST/$NAME
done
done

# Copy the top-level static files
cp -R $SRC/{*.html,*.js,*.css,*.png} $DST

# Replace all /nix/store hrefs for ghc documentation in the destination folder.
for NAME in "${PACKAGE_NAMES[@]}"; do
for NAME in $PACKAGE_NAMES; do
find "$DST/$NAME" -type f -name "*.html" | while read -r FILE; do
sed -i -E "s|file:///nix/store/.*-ghc-.*-doc/.*/libraries/([^0-9]*)-[0-9][^/]*/(.*)|../../\1/\2|g" $FILE
done
Expand All @@ -71,7 +71,7 @@ if grep -q -R -E "/nix/store/.*" $DST; then
fi

# Replace all dist-newstyle hrefs in the destination folder.
for NAME in "${PACKAGE_NAMES[@]}"; do
for NAME in $PACKAGE_NAMES; do
find "$DST/$NAME" -type f -name "*.html" | while read -r FILE; do
sed -i -E "s|file:///.*dist-newstyle/.*/doc/html/(.*)|../../\1|g" $FILE
done
Expand Down
Loading