Skip to content

Commit

Permalink
Symlink package names without version
Browse files Browse the repository at this point in the history
This lets us easily link to the most recent documentation.
  • Loading branch information
liskin committed Aug 7, 2021
1 parent 7c2d0ae commit 7e6bb90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ jobs:
)
echo "::set-output name=dir::$dir"
# make symlinks to package names without version so that we can link
# to the most recent documentation
./symlink-packages.sh "$dir"
touch "$dir"/.nojekyll
- name: Deploy to GitHub Pages
Expand Down
13 changes: 13 additions & 0 deletions symlink-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -eu

function o { printf -->&2 "%s:%s\\n" "${0##*/}" "$(printf " %q" "$@")"; "$@"; }

cd "${1:?}"

for dir in */; do
if [[ $dir =~ ^(([[:alnum:]]*[[:alpha:]][[:alnum:]]*-)+)[0-9\.]+/$ ]]; then
o ln -sf "${dir%/}" "${BASH_REMATCH[1]%-}"
fi
done

0 comments on commit 7e6bb90

Please sign in to comment.