Skip to content

Instantly share code, notes, and snippets.

@motemen
Last active August 29, 2015 14:22
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 motemen/bcb3d76a670a4f2f08af to your computer and use it in GitHub Desktop.
Save motemen/bcb3d76a670a4f2f08af to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
name=$(node -p -e 'require("./bower.json").name')
out=./gh-pages
rm -rf $out
mkdir -p $out
cp -R bower_components $out/components
git archive --prefix=components/$name/ HEAD | tar x -C $out
git rev-parse HEAD > $out/GIT_REVISION
cat $out/components/$name/index.html | sed "s:<head>:<head><base href='components/$name/'>:" > $out/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment