Skip to content

Instantly share code, notes, and snippets.

@inikulin
Last active April 20, 2017 13:18
Show Gist options
  • 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