Skip to content

Instantly share code, notes, and snippets.

@ragingwind
Last active December 9, 2015 22:11
Show Gist options
  • Save ragingwind/7aae9f5abc1be4fa5783 to your computer and use it in GitHub Desktop.
Save ragingwind/7aae9f5abc1be4fa5783 to your computer and use it in GitHub Desktop.
# 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