Skip to content

Commit dd59017

Browse files
authored
website: Allow Regal import to use local dir (#8312)
This allows testing of regal docs changes without pulling them from a remote, useful if testing changes to content with docusaurus bits in. Signed-off-by: Charlie Egan <charlie_egan@apple.com>
1 parent fc55be8 commit dd59017

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

docs/bin/import-regal-docs.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,24 @@ download_regal() {
5454
curl --silent -L -o regal.zip "$url"
5555
}
5656

57-
if [[ ! -e regal.zip ]]; then
58-
download_regal
57+
if [[ -v REGAL_LOCAL_PATH && -d "$REGAL_LOCAL_PATH" ]]; then
58+
echo "Using local Regal directory: $REGAL_LOCAL_PATH"
59+
regal_docs_src="$REGAL_LOCAL_PATH/docs"
5960
else
60-
echo "Using existing regal.zip"
61-
fi
61+
if [[ ! -e regal.zip ]]; then
62+
download_regal
63+
else
64+
echo "Using existing regal.zip"
65+
fi
6266

63-
tempdir=$(mktemp -d)
67+
tempdir=$(mktemp -d)
6468

65-
unzip regal.zip -d "$tempdir" 2>&1 > /dev/null
69+
unzip regal.zip -d "$tempdir" 2>&1 > /dev/null
6670

67-
mv $tempdir/*/* $tempdir
71+
mv $tempdir/*/* $tempdir
6872

69-
regal_docs_src="$tempdir/docs"
73+
regal_docs_src="$tempdir/docs"
74+
fi
7075
regal_docs_dest="projects/regal"
7176

7277
rm -rf "$regal_docs_dest"

0 commit comments

Comments
 (0)