Skip to content

Commit

Permalink
fix docsite build script
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Jul 17, 2019
1 parent 7552af9 commit c5c0e22
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build]
command = "npm run docsite build"
publish = "docsite-build"
publish = "openzeppelin-docs/build/site"
22 changes: 16 additions & 6 deletions scripts/docsite.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
#!/usr/bin/env bash

# usage: npm run docsite
if [ "$1" != "build" -a "$1" != "start" ];then
echo "usage: npm run docsite (build|start)" >&2
exit 1
fi

set -o errexit

if [ ! -d openzeppelin-docs ]; then
git clone https://github.com/frangio/openzeppelin-docs.git
fi

git -C openzeppelin-docs pull
git -C openzeppelin-docs pull -q

if [ "$1" = "build" ]; then
npm run prepare-docs
cd docs
env DISABLE_PREPARE_DOCS= node ../openzeppelin-docs/build-local.js

npx concurrently \
'nodemon --delay 1 -e "*" -w contracts -w "docs/*.hbs" -x npm run prepare-docs' \
'cd docs; env DISABLE_PREPARE_DOCS= nodemon --delay 1 -e adoc,yml ../openzeppelin-docs/build-local.js' \
'http-server -c-1 openzeppelin-docs/build/site'
elif [ "$1" = "start" ]; then
npx concurrently \
'nodemon --delay 1 -e "*" -w contracts -w "docs/*.hbs" -x npm run prepare-docs' \
'cd docs; env DISABLE_PREPARE_DOCS= nodemon --delay 1 -e adoc,yml ../openzeppelin-docs/build-local.js' \
'http-server -c-1 openzeppelin-docs/build/site'
fi

0 comments on commit c5c0e22

Please sign in to comment.