====
* Better sandbox template
+ * Should work for more use cases.
* Should be indepotent.
* Asking whether to setup:
* Vagrant.
#
# Setup a new code project.
#
-# TODO: should work for more use cases.
# Parameters
BASENAME="`basename $0`"
BOOTSTRAP="git://git.sarava.org/puppet-bootstrap.git"
TEMPLATES="git://git.sarava.org/templates.git"
+# Initialize project
function sandbox_init {
echo "Initializing $PROJECT..."
mkdir -p $CODE/$PROJECT
}
+# Git integration
function sandbox_git {
(
cd $CODE/$PROJECT
)
}
-function sandbox_ikiwiki {
# Ikiwiki integration
+function sandbox_ikiwiki {
(
if [ ! -d "$HOME/file/templates" ]; then
echo "Please clone $TEMPLATES into $HOME/file/templates"
cd $CODE/$PROJECT
git checkout develop
- cat $HOME/file/templates/ikiwiki/.gitignore >> .gitignore
+ if [ ! -e ".gitignore" ]; then
+ cp $HOME/file/templates/ikiwiki/.gitignore .
+ elif ! grep -q -f $HOME/file/templates/ikiwiki/.gitignore; then
+ cat $HOME/file/templates/ikiwiki/.gitignore >> .gitignore
+ fi
if [ ! -e "index.mdwn" ]; then
cp $HOME/file/templates/ikiwiki/index.mdwn .
)
}
+# Vagrant integration
function sandbox_vagrant {
- # Vagrant integration
(
echo ""
echo "Setting up vagrant integration..."