Skip to content

Instantly share code, notes, and snippets.

@inikulin
Last active April 20, 2017 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inikulin/b8a9eea7fee5e3438925fb5a3981e777 to your computer and use it in GitHub Desktop.
Save inikulin/b8a9eea7fee5e3438925fb5a3981e777 to your computer and use it in GitHub Desktop.
#!/bin/bash
parse5=(parse5 https://github.com/inikulin/parse5 1)
html=(html https://github.com/whatwg/html 0)
tests=(html5lib-tests https://github.com/html5lib/html5lib-tests 0)
htmlbuild=(html-build https://github.com/whatwg/html-build 0)
update() {
local init=1
local repo=(${!1})
if [ -d "${repo[0]}" ]; then
init=0
fi
echo "--- UPDATING ${repo[0]} ---"
if [ "${init}" == "1" ]; then
git clone https://github.com/HTMLParseErrorWG/${repo[0]}
fi
cd ${repo[0]}
if [ "${init}" == "1" ]; then
git remote add upstream ${repo[1]}
fi
git pull --rebase
git fetch upstream
git rebase upstream/master
if [ "${init}" == "1" ] && [ "${repo[2]}" == "1" ]; then
npm install
fi
cd ../
}
update parse5[@] &&
update html[@] &&
update htmlbuild[@] &&
update tests[@]
@inikulin
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment