Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions samples/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ echo ">>>Running docs.sh"
# Copy static documentation files as part of the build process.
NAME=$1 # The name of the folder, taken from package.json "build" line.

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

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # Script directory (/samples)
PROJECT_ROOT=$(dirname "$SCRIPT_DIR") # Get the parent directory (js-api-samples)
DIST_DIR="${PROJECT_ROOT}/dist"
SAMPLE_DIR="${PROJECT_ROOT}/dist/samples/${NAME}"

echo "PROJECT_ROOT: ${PROJECT_ROOT}"

DOCS_DIR="${PROJECT_ROOT}/dist/samples/${NAME}/docs"

# Create a new folder.
Expand Down
Loading