File tree Expand file tree Collapse file tree 2 files changed +67
-1
lines changed
Expand file tree Collapse file tree 2 files changed +67
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ ENV=" ${ENV:- dev} "
5+ DIST_DIR=" bin/dist"
6+ TARGET_DIR=" $DIST_DIR /snippets"
7+ PACKAGE_VERSION=" ${PACKAGE_VERSION:- 0.0.0} "
8+
9+ archive_dist_dir () {
10+ DIR=" $1 "
11+ (cd " $DIST_DIR " && tar zcvf " nativescript-$DIR -$ENV -$PACKAGE_VERSION .tar.gz" $DIR )
12+ }
13+
14+ npm_install () {
15+ # Don't install modules twice.
16+
17+ MARKER_FILE=" ./node_modules/installed"
18+ if [ ! -f " $MARKER_FILE " ] ; then
19+ npm install
20+ touch " $MARKER_FILE "
21+ fi
22+ }
23+
24+ extract_snippets () {
25+ BIN=" ./node_modules/markdown-snippet-injector/extract.js"
26+
27+ npm install markdown-snippet-injector
28+
29+ for SNIPPET_DIR in {tests,apps,tns-core-modules} ; do
30+ echo " Extracting snippets from: $SNIPPET_DIR "
31+ node " $BIN " --root=" $SNIPPET_DIR " --target=" $TARGET_DIR " \
32+ --sourceext=" .js|.ts|.xml|.html|.css"
33+ done
34+
35+ archive_dist_dir " snippets"
36+ }
37+
38+ extract_cookbook () {
39+ COOKBOOK_DIR=" $DIST_DIR /cookbook"
40+ rm -rf " $COOKBOOK_DIR "
41+
42+ npm_install
43+ grunt articles
44+ mv " $DIST_DIR /articles" " $COOKBOOK_DIR "
45+ archive_dist_dir " cookbook"
46+ }
47+
48+ extract_apiref () {
49+ APIREF_DIR=" $DIST_DIR /api-reference"
50+ rm -rf " $APIREF_DIR "
51+
52+ npm_install
53+ npm run typedoc
54+
55+ mv " $DIST_DIR /apiref" " $APIREF_DIR "
56+ archive_dist_dir " api-reference"
57+ }
58+
59+ rm -rf " $TARGET_DIR "
60+ mkdir -p " $TARGET_DIR "
61+
62+ if [ " ${BASH_SOURCE[0]} " == " $0 " ] ; then
63+ extract_snippets
64+ extract_cookbook
65+ extract_apiref
66+ fi
Original file line number Diff line number Diff line change 2222 "grunt-ts" : " 6.0.0-beta.11" ,
2323 "grunt-typedoc" : " 0.2.4" ,
2424 "http-server" : " ^0.9.0" ,
25- "markdown-snippet-injector" : " 0.1.1 " ,
25+ "markdown-snippet-injector" : " 0.2.2 " ,
2626 "mocha" : " 2.2.5" ,
2727 "nativescript-typedoc-theme" : " git+https://github.com/NativeScript/nativescript-typedoc-theme.git#master" ,
2828 "shelljs" : " ^0.7.0" ,
You can’t perform that action at this time.
0 commit comments