From dfa541a050ac7e7fd7d162fc28955baf4795d218 Mon Sep 17 00:00:00 2001 From: Noah Jorgenson Date: Mon, 28 Dec 2015 12:47:09 -0800 Subject: [PATCH] Docs for website setup - always start website/setup.sh in website - use setup.sh in website README --- website/README.md | 16 +++++----------- website/setup.sh | 4 +++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/website/README.md b/website/README.md index 37afeadb98..5c162aab6f 100644 --- a/website/README.md +++ b/website/README.md @@ -2,13 +2,13 @@ The first time, get all the dependencies loaded via -``` +```sh npm install ``` Then, run the server via -``` +```sh npm start open http://localhost:8079/react-native/index.html ``` @@ -19,18 +19,12 @@ Anytime you change the contents, just refresh the page and it's going to be upda First setup your environment by having two folders, one `react-native` and one `react-native-gh-pages`. The publish script expects those exact names. -``` -cd ../../ -git clone git@github.com:facebook/react-native.git react-native-gh-pages -cd react-native-gh-pages -git checkout origin/gh-pages -git checkout -b gh-pages -git push --set-upstream origin gh-pages -cd ../react-native/website +```sh +./setup.sh ``` Then, after you've done changes, just run the command and it'll automatically build the static version of the site and publish it to gh-pages. -``` +```sh ./publish.sh ``` diff --git a/website/setup.sh b/website/setup.sh index 094926583d..9c496abf69 100755 --- a/website/setup.sh +++ b/website/setup.sh @@ -7,6 +7,9 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. +# Start in website/ even if run from root directory +cd "$(dirname "$0")" + cd ../../ if [ "$TRAVIS" ]; then git clone "https://reactjs-bot@github.com/facebook/react-native.git" react-native-gh-pages @@ -18,4 +21,3 @@ git checkout origin/gh-pages git checkout -b gh-pages git branch --set-upstream-to=origin/gh-pages cd ../react-native/website -