Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit c8d2687

Browse files
amcdnljelbourn
authored andcommitted
chore(build): add script for fetching assets locally (#193)
1 parent 7b53cfc commit c8d2687

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

tools/fetch-assets-local.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Base Source Path
4+
if [ -d ~/material2 ] ; then
5+
echo "- Using path ~/material2"
6+
baseSrcPath=~/material2
7+
elif [ -d ../material2 ] ; then
8+
echo "- Using path ../material2"
9+
baseSrcPath=../material2
10+
elif [ -d ${MATERIAL2_LOCAL} ] ; then
11+
echo "- Using MATERIAL2_LOCAL env variable"
12+
baseSrcPath = ${MATERIAL2_LOCAL}
13+
fi
14+
15+
# Ensure Docs Dist
16+
if [ ! -d ${baseSrcPath}/dist/docs ] ; then
17+
echo "- Missing /dist/docs...Running 'gulp docs'"
18+
( cd ${baseSrcPath} && gulp docs )
19+
fi
20+
21+
# Ensure Material Examples Pkg
22+
if [ ! -d ${baseSrcPath}/dist/releases/material-examples ] ; then
23+
echo "- Missing material-examples...Running 'gulp material-examples:build-release'"
24+
( cd ${baseSrcPath} && gulp material-examples:build-release)
25+
fi
26+
27+
# Base Target Path
28+
baseTargetPath=./src/assets
29+
30+
# Copy Packages
31+
mkdir -p ./node_modules/@angular/material-examples
32+
cp -r ${baseSrcPath}/dist/releases/material-examples ./node_modules/@angular/
33+
34+
# Copy Examples
35+
cp -r ${baseSrcPath}/dist/docs/examples ${baseTargetPath}
36+
37+
# Copy API Files
38+
cp -r ${baseSrcPath}/dist/docs/api ${baseTargetPath}/documents
39+
40+
# Copy Guide files
41+
mkdir -p ./src/assets/documents/guides
42+
cp ${baseSrcPath}/dist/docs/markdown/*.html ${baseTargetPath}/documents/guides
43+
44+
# Copy Overview
45+
mkdir -p ./src/assets/documents/overview
46+
cp ${baseSrcPath}/dist/docs/markdown/*/*.html ${baseTargetPath}/documents/overview

0 commit comments

Comments
 (0)