-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·42 lines (38 loc) · 1003 Bytes
/
bootstrap
File metadata and controls
executable file
·42 lines (38 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This creates a new plugin based on micrositeComponentBoilerplate repo
############################
# usage:
# $ ./bootstrap pluginName 'description of the plugin'
#
# notes:
# plugin will be created off of parent directory
#
# requires:
# http://defunkt.io/hub/
############################
########## Variables
plugin=$1
description=$2
########## Script
echo "creating ${plugin} plugin..."
cd ..
git clone https://github.com/TechTarget/micrositeComponentBoilerplate.git $plugin
cd $plugin
rm -rf ./.git
for file in `find . -name 'pluginName.*'`; do
mv "$file" "${file/pluginName/$plugin}"
done
echo 'creating readme file'
echo $description > readme.md
for file in $(grep -r -l '{{@pluginName}}' ./*) ; do
if [ $file != './bootstrap' ]; then
sed "s/{{@pluginName}}/$plugin/g" $file > $file.$$ && mv $file.$$ $file
fi
done
mv makefile.tmp makefile
make
rm bootstrap
git init
git add . && git commit -m 'initial commit'
hub create -d "${description}"
git push -u origin master