Skip to content

Instantly share code, notes, and snippets.

Created September 21, 2013 20:54
Show Gist options
  • Save anonymous/6654077 to your computer and use it in GitHub Desktop.
Save anonymous/6654077 to your computer and use it in GitHub Desktop.
#!/bin/sh
DARTFILENAME=$1.dart
HTMLFILENAME=$1.html
ELEMENTNAME=$2
LIBNAME=`echo $2 | sed -e "s/-/_/g"`
CLASSNAME=$3
echo > $HTMLFILENAME
echo "<head>" >> $HTMLFILENAME
echo "</head>" >> $HTMLFILENAME
echo "<body>" >> $HTMLFILENAME
echo "<polymer-element name=\"$ELEMENTNAME\">" >> $HTMLFILENAME
echo "<template>" >> $HTMLFILENAME
echo "</template>" >> $HTMLFILENAME
echo "<script type=\"application/dart\" src=\"$DARTFILENAME\"></script>" >> $HTMLFILENAME
echo "</polymer-element>" >> $HTMLFILENAME
echo "</body>" >> $HTMLFILENAME
echo >> $HTMLFILENAME
echo > $DARTFILENAME
echo "library $LIBNAME;" >> $DARTFILENAME
echo "" >> $DARTFILENAME
echo "import 'package:polymer/polymer.dart';" >> $DARTFILENAME
echo "" >> $DARTFILENAME
echo "class $CLASSNAME extends PolymerElement with ObservableMixin {" >> $DARTFILENAME
echo "}" >> $DARTFILENAME
echo >> $DARTFILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment