Skip to content

Commit

Permalink
Fix combined_haddock.sh script (IntersectMBO#6199)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored and v0d1ch committed Dec 6, 2024
1 parent e44d309 commit e244ea2
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit e244ea2

Please sign in to comment.