Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Cloning Polymer/tools to workspace
git clone git://github.com/Polymer/tools.git
# Make a tmp directory
mkdir tmp; cd tmp
# Execute gp.sh script
# ueses: tools/bin/gp.sh <your-account> <repository-name>
../tools/bin/gp.sh ragingwind ragingwind-seed-element
# Opening landing page (gh_pages)
# eg. open http://<your-account>.github.io/<repository-name>
open http://ragingwind.github.io/ragingwind-seed-element

How to Script: Polymer Offical Boilerplate

# Create a new repository for brand new Polymer element
open http://github.com/new
# Input your element name to repository and submit
# eg. ragingwind-seed-element
# Do git
git init; git add .; git commit -m 'My first version'
# eg. https://github.com/ragingwind-seed-element.git
git remote add origin https://github.com/<your-account>/<your-brand-new-element-name>.git
# Push the source to github
git push -u origin master
# Check the repository
# Create a workspace for project
mkdir my-app; cd my-app
# Download and unpack official boilerplage package
# from github, PolymerLab
wget https://github.com/PolymerLabs/seed-element/archive/v0.1.0.tar.gz
tar xvf v0.1.0.tar.gz
# Rename the element to own element-name (eg ragingwind-seed-element)
# Rename the element's path
mv seed-element-0.1.0 ragingwind-seed-element; cd ragingwind-seed-element
# Rename the element string in source files
sed -i -e 's/seed-element/ragingwind-seed-element/g' ./bower.json ./demo.html ./index.html ./seed-element.css ./seed-element.html ./tests/index.html ./tests/seed-element-basic.html ./tests/tests.html
rm *-e
# Rename the element source code file name
mv ./seed-element.css ./ragingwind-seed-element.css
mv ./seed-element.html ./ragingwind-seed-element.html
# Install Bower packages and check that
bower install; ls -al ..
# Run webserver in parent path to preview seed-element
cd ..; http-server
# or
python -m SimpleHTTPServe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment