JosephPecoraro / scripts

Some scripts I have written and tend to keep up to date. They reside in my personal bin folder.

scripts / proj
100755 30 lines (25 sloc) 0.705 kb
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
#!/bin/bash
# Author: Joseph Pecoraro
# Date: Wednesday February 25, 2009
# Description: Super-Quick stub for a new project!
 
# Expects an string for a folder name
if [ ! -n "$1" ]; then
echo "usage: `basename $0` name"
  exit 1
fi
 
# Vars
name=$1
htdocs='/Applications/MAMP/htdocs/'
templatename='TEMPLATE'
 
# 1. The Dir Doesnt Exist, Create it from the Template
if [ ! -e "$htdocs$name" ]; then
echo "Creating $htdocs$name ..."
  cp -R "$htdocs$templatename" "$htdocs$name"
  rm -rf "$htdocs$name/.git"
  rm "$htdocs$name/README.markdown"
  rm "$htdocs$name/proj"
fi
 
# 2. Open in Finder and TextMate
echo "Opening $htdocs$name ..."
/usr/bin/env open "$htdocs$name"
/usr/bin/env mate "$htdocs$name"