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

Commit 1acc345

Browse files
devversionjelbourn
authored andcommitted
build: fix fetch assets local script (#198)
* Currently the `fetch-assets-local` script tries to copy every `.html` file to the `src/assets` folder. This includes multiple `README.html` files. Bash at this point complains that there are multiple files with the same name are copied to the same destination. * Also ensures that the CWD of the fetch script is always the root of the project.
1 parent 921502a commit 1acc345

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"test": "ng test",
1010
"pree2e": "webdriver-manager update",
1111
"e2e": "protractor",
12-
"build-themes": "./tools/build-themes.sh",
12+
"build-themes": "bash ./tools/build-themes.sh",
1313
"prod-build": "npm run build-themes && ng build --aot --prod && npm run prerender && cp -r tmp/prerendered/* dist/",
14-
"postinstall": "webdriver-manager update && tools/fetch-assets.sh",
14+
"postinstall": "webdriver-manager update && bash ./tools/fetch-assets.sh",
1515
"publish-prod": "npm run build-themes && ng build --aot --prod && firebase use material-angular-io && firebase deploy",
1616
"publish-dev": "npm run build-themes && ng build --aot --prod && firebase use material2-docs-dev && firebase deploy"
1717
},

tools/fetch-assets-local.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Go to project directory
4+
cd $(dirname ${0})/..
5+
36
# Base Source Path
47
if [ -d ~/material2 ] ; then
58
echo "- Using path ~/material2"
@@ -21,8 +24,10 @@ fi
2124
# Base Target Path
2225
baseTargetPath=./src/assets
2326

27+
# Path to all overview HTML files.
28+
overviewHtmlFiles=$(find ${baseSrcPath}/dist/docs/markdown -path "*/*.html" ! -name 'README.*')
29+
2430
# Copy Packages
25-
mkdir -p ./node_modules/@angular/material-examples
2631
cp -r ${baseSrcPath}/dist/releases/material-examples ./node_modules/@angular/
2732

2833
# Copy Examples
@@ -37,4 +42,4 @@ cp ${baseSrcPath}/dist/docs/markdown/*.html ${baseTargetPath}/documents/guides
3742

3843
# Copy Overview
3944
mkdir -p ./src/assets/documents/overview
40-
cp ${baseSrcPath}/dist/docs/markdown/*/*.html ${baseTargetPath}/documents/overview
45+
cp ${overviewHtmlFiles} ${baseTargetPath}/documents/overview

0 commit comments

Comments
 (0)