Skip to content

Commit 9455e01

Browse files
authored
feat: Updates scripts to handle 'src' folder. (#853)
1 parent f350def commit 9455e01

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

samples/docs.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ cp "${SCRIPT_DIR}/${NAME}/index.js" "${DOCS_DIR}/index.js"
2727
cp "${SCRIPT_DIR}/${NAME}/index.html" "${DOCS_DIR}/index.html"
2828
cp "${SCRIPT_DIR}/${NAME}/style.css" "${DOCS_DIR}/style.css"
2929

30-
# Copy the data folder if one is found.
30+
# Copy the public folder if one is found (graphics, other static files).
3131
if [ -d "public" ] && [ "$(ls -A public)" ]; then
3232
cp -r public/* "${DOCS_DIR}/"
3333
fi
34+
35+
# Copy the src folder if one is found (.js, .json, anything parseable by Vite).
36+
if [ -d "src" ] && [ "$(ls -A src)" ]; then
37+
cp -r src/* "${DOCS_DIR}/"
38+
fi

samples/jsfiddle.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ cp "${SCRIPT_DIR}/${NAME}/index.js" "${DIST_DIR}/samples/${NAME}/jsfiddle/demo.j
3232
cp "${SCRIPT_DIR}/${NAME}/index.html" "${DIST_DIR}/samples/${NAME}/jsfiddle/demo.html"
3333
cp "${SCRIPT_DIR}/${NAME}/style.css" "${DIST_DIR}/samples/${NAME}/jsfiddle/demo.css"
3434

35-
# Copy the data folder if one is found.
36-
[ -d "public" ] && cp -r public/* "${DIST_DIR}/samples/${NAME}/jsfiddle/"
35+
# Copy the public folder if one is found (graphics, other static files).
36+
if [ -d "public" ] && [ "$(ls -A public)" ]; then
37+
cp -r public/* "${DOCS_DIR}/"
38+
fi
39+
40+
# Copy the src folder if one is found (.js, .json, anything parseable by Vite).
41+
if [ -d "src" ] && [ "$(ls -A src)" ]; then
42+
cp -r src/* "${DOCS_DIR}/"
43+
fi
3744

3845
# Remove region tags from files by type, since they all have different comment conventions.
3946
# We use a conditional here since sed behaves differently on Linux.

0 commit comments

Comments
 (0)