forked from gregorwolf/SAP-NPM-API-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·23 lines (22 loc) · 872 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
npm config rm @sap:registry
# rm -rf node_modules
# mkdir node_modules
npm install
cp package.json package-original.json
cp new-package.json package.json
node update-package-json.js
jq '.' new-package.json > package.json
cp package.json new-package.json
# npm install
# Reduce list of packages to update by using diff on package.json
git diff package.json | grep + | grep "@sap" | sed 's/[^"]*"\([^"]*\).*/\1/' > packages.txt
while read package; do
./npm_download.sh $package
packageNoPrefix=`echo $package | sed 's/@sap//g'`
mkdir "apis$packageNoPrefix"
rsync -zarv --include "*/" --include="*.md" --exclude="*" "node_modules/$package/" "apis$packageNoPrefix"
cp node_modules/$package/LICENS* apis$packageNoPrefix
cp -r node_modules/$package/doc apis$packageNoPrefix/doc
done <packages.txt
#mkdocs build -f mkdocs.yml
cp package-original.json package.json