Rename to more descriptive script name
Also update for Travis use.
This commit is contained in:
1 parent
bbbbc785f5
commit
0b5815bbd0
2 files changed
+13
-6
No files matched your search
@@ -7,6 +7,7 @@
|
||||
"build": "npm run clean && webpack --progress --colors --bail",
|
||||
"clean": "rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
|
||||
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1)\"",
|
||||
"prune": "./prune-gh-pages.sh",
|
||||
"i18n:src": "babel src > tmp.js && rimraf tmp.js && build-i18n-src ./translations/messages/ ./translations/",
|
||||
"start": "webpack-dev-server",
|
||||
"test": "npm run test:lint && npm run test:unit && npm run build && npm run test:integration",
|
||||
|
||||
@@ -14,20 +14,26 @@ function deslash () {
|
||||
fi
|
||||
}
|
||||
|
||||
repository=origin
|
||||
|
||||
if [[ $1 != "" ]]
|
||||
then
|
||||
repository=$1
|
||||
fi
|
||||
|
||||
# Cache current branch
|
||||
current=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# Checkout most recent gh-pages
|
||||
git fetch upstream
|
||||
git fetch origin
|
||||
git checkout -f gh-pages-empty-history
|
||||
git reset --hard origin/gh-pages-empty-history
|
||||
git checkout -f gh-pages
|
||||
git reset --hard origin/gh-pages
|
||||
|
||||
# Make an array of directories to not delete, from the list of remote branches
|
||||
branches=$(git branch -r --list upstream/*)
|
||||
branches=$(git branch -r --list origin/*)
|
||||
|
||||
# Strip off the remote name prefix
|
||||
branches="${branches[@]//upstream\//}"
|
||||
branches="${branches[@]//origin\//}"
|
||||
|
||||
# Add parent directories of branches to the exclusion list (e.g. greenkeeper/)
|
||||
for branch in $branches; do
|
||||
@@ -45,7 +51,7 @@ find . -type d \( -path ./.git $(printf " -o -path ./%s" $branches) \) -prune -o
|
||||
# Push
|
||||
git add -u
|
||||
git commit -m "Remove stale directories"
|
||||
# git push origin gh-pages
|
||||
git push $repository gh-pages
|
||||
|
||||
# Return to where we were
|
||||
git checkout -f $current
|
||||
Reference in new issue
Block a user