Skip to content

Commit 9caca97

Browse files
authored
fix: Updates docs.sh to have the correct path generation code. (#120)
1 parent f85cbd1 commit 9caca97

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

samples/docs.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@ echo ">>>Running docs.sh"
77
# Copy static documentation files as part of the build process.
88
NAME=$1 # The name of the folder, taken from package.json "build" line.
99

10-
# Relative path to the top-level of the examples folder.
11-
# /Users/[USERNAME]/git/js-api-samples/samples or similar
12-
# Define path based on platform.
13-
if [[ "$OSTYPE" == "darwin"* ]]; then
14-
echo "Hello, Mac!"
15-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
16-
echo "Project path: ${SCRIPT_DIR}"
17-
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
18-
echo "Hello, gLinux!"
19-
SCRIPT_DIR="$(dirname "$0")"
20-
echo "Project path: ${SCRIPT_DIR}"
21-
fi
10+
# /Users/[USERNAME]/git/js-api-samples/samples
2211

12+
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # Script directory (/samples)
2313
PROJECT_ROOT=$(dirname "$SCRIPT_DIR") # Get the parent directory (js-api-samples)
14+
DIST_DIR="${PROJECT_ROOT}/dist"
15+
SAMPLE_DIR="${PROJECT_ROOT}/dist/samples/${NAME}"
16+
17+
echo "PROJECT_ROOT: ${PROJECT_ROOT}"
18+
2419
DOCS_DIR="${PROJECT_ROOT}/dist/samples/${NAME}/docs"
2520

2621
# Create a new folder.

0 commit comments

Comments
 (0)