Last active
December 20, 2015 23:49
-
-
Save lejeunerenard/6215895 to your computer and use it in GitHub Desktop.
A very opinionated Dancer/Choreographer Initialization/Scaffolding Script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Initializing App..." | |
# ===== Install git submodules ===== | |
echo "Installing git submodules..." | |
git submodule add https://github.com/HighgateCross/Form-Functions.git public/javascripts/form_functions | |
git submodule add https://github.com/HighgateCross/Validate.git lib/Validate | |
git submodule add https://github.com/HighgateCross/Stagehand.git lib/Stagehand | |
git submodule add https://github.com/malsup/form.git public/javascripts/form | |
echo "Done" | |
# ===== Create Share folder ===== | |
echo "Creating share folder..." | |
if [ -d ./share ] | |
then | |
echo "Share folder already exists... Skipping" | |
else | |
mkdir ./share | |
echo "Done" | |
fi | |
# ===== Create Documents folder ===== | |
echo "Creating Documents folder..." | |
if [ -d ./public/documents ] | |
then | |
echo "Documents folder already exists... Skipping" | |
else | |
mkdir ./public/documents | |
echo "Done" | |
fi | |
# ===== Create cpanfile ===== | |
echo "Creating cpanfile..." | |
if [ -f ./cpanfile ] | |
then | |
echo "cpanfile already exists... Skipping" | |
else | |
touch ./cpanfile | |
echo "requires 'Dancer'; | |
requires 'Dancer::Plugin::DBIC'; | |
requires 'YAML'; | |
requires 'Template'; | |
requires 'Email::Valid'; | |
requires 'HTML::TagFilter'; | |
requires 'DBIx::Class::Validation::Structure'; # Built in validation for DBIC | |
requires 'HTML::FillInForm';" > ./cpanfile | |
echo "Done" | |
fi | |
# ===== Create .gitignore ===== | |
echo "Creating .gitignore..." | |
if [ -f ./.gitignore ] | |
then | |
echo ".gitignore already exists... Skipping" | |
else | |
touch ./.gitignore | |
echo ".carton | |
local/ | |
*.swp | |
*.swq" > ./.gitignore | |
echo "Done" | |
fi | |
# ===== Install Carton Modules ===== | |
echo "Install Carton Modules..." | |
if [ -f ./cpanfile ] | |
then | |
carton install | |
echo "Done" | |
else | |
echo "cpanfile doesn't exist... Skipping" | |
fi | |
echo "Done initializing App" | |
echo "" | |
echo "Do not forget to add javascripts into your layout's <head> tag!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment