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

Commit 2e3c7ab

Browse files
authored
Update asset fetch script to use real repo (#129)
1 parent e704d54 commit 2e3c7ab

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

tools/fetch-assets.sh

+26-22
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@
33
# Fetch material2 assets from material2-docs-content repo.
44

55

6-
ASSETS_DOCS_PATH=./src/assets/documents/
7-
ASSETS_EXAMPLES_PATH=./src/assets/examples/
8-
DEST_PATH=/tmp/material-assets
9-
DOCS_REPO=https://github.com/DevVersion/material2-docs-content
10-
DOCS_API_PATH=$DEST_PATH/api
11-
DOCS_GUIDES_PATH=$DEST_PATH/guides
12-
DOCS_OVERVIEW_PATH=$DEST_PATH/overview
13-
DOCS_EXAMPLES_PATH=$DEST_PATH/examples/
14-
15-
# create folder structure
16-
if [ ! -d $DEST_PATH ]; then
17-
mkdir -p $DEST_PATH
18-
fi
19-
20-
if [ ! -d $ASSETS_EXAMPLES_PATH ]; then
21-
mkdir -p $ASSETS_EXAMPLES_PATH $ASSETS_DOCS_PATH
22-
fi
6+
# Dir where documentation assets will be copied (overviews, api docs)
7+
docAssetsPath=./src/assets/documents/
8+
9+
# Dir where live-example assets will be copied
10+
exampleAssetsPath=./src/assets/examples/
11+
12+
# Dir where published assets will temporarily copied to (using `git clone`).
13+
tmpAssetClonePath=/tmp/material-assets
14+
15+
# GitHub repo which contains snapshots of the docs content from angular/material2.
16+
docsContentRepo=https://github.com/angular/material2-docs-content
17+
18+
# Dirs for each of api docs, guides, overviews, and live-examples within the
19+
# cloned content repo.
20+
apiPath=$tmpAssetClonePath/api
21+
guidesPath=$tmpAssetClonePath/guides
22+
overviewPath=$tmpAssetClonePath/overview
23+
examplesPath=$tmpAssetClonePath/examples/
24+
25+
# Create folders into which to copy content and assets.
26+
mkdir -p $tmpAssetClonePath
27+
mkdir -p $exampleAssetsPath $docAssetsPath
2328

2429
# Pull assets from repo and remove .git directory
25-
git clone $DOCS_REPO $DEST_PATH
26-
rm -rf $DEST_PATH/.git
30+
git clone $docsContentRepo $tmpAssetClonePath
2731

2832
# Copy files over to their proper place in src/assets
29-
cp -r $DOCS_API_PATH $DOCS_OVERVIEW_PATH $DOCS_GUIDES_PATH $ASSETS_DOCS_PATH
30-
cp -r $DOCS_EXAMPLES_PATH $ASSETS_EXAMPLES_PATH
33+
cp -r $apiPath $overviewPath $guidesPath $docAssetsPath
34+
cp -r $examplesPath $exampleAssetsPath
3135

3236
# Remove temporary directory
33-
rm -rf $DEST_PATH
37+
rm -rf $tmpAssetClonePath

0 commit comments

Comments
 (0)