Skip to content

Instantly share code, notes, and snippets.

@matiskay
Created August 4, 2011 05:16
Show Gist options
  • Save matiskay/1124544 to your computer and use it in GitHub Desktop.
Save matiskay/1124544 to your computer and use it in GitHub Desktop.
Create a scaffold to develop a html project
#!/bin/bash
PROYECTNAME=$1
function GenerateIndex {
{
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
echo '<html>'
echo ' <head>'
echo ' <title></title>'
echo ' <link type="text/css" rel="stylesheet" href="css/reset.css" />'
echo ' <link type="text/css" rel="stylesheet" href="css/style.css" />'
echo ' <script type="text/javascript" src="js/custom.js"></script>'
echo ' </head>'
echo ' <body>'
echo ' </body>'
echo '</html>'
} > index.html
}
if [[ ! $PROYECTNAME ]]; then
printf "Just type html.sh <projectname>\n"
exit 1
fi
if [[ -d $PROYECTNAME ]]; then
printf "The %s folder already exists \n" "$PROYECTNAME"
printf "Please select another name \n"
exit 0
fi
printf "Instaling %s \n" "$PROYECTNAME"
echo "----------------"
mkdir $PROYECTNAME
cd $PROYECTNAME
mkdir css
cd css
printf "Downloading %s \n" "YUI reset 3.3"
wget -q "http://yui.yahooapis.com/3.3.0/build/cssreset/reset.css"
touch style.css
cd ..
mkdir js
cd js
printf "Downloading %s \n" "jquery 1.6.1"
wget -q "http://code.jquery.com/jquery-1.6.1.js" -O jquery.js
touch custom.js
cd ..
mkdir img
GenerateIndex
git init
git add .
git commit -m"The $PROYECTNAME"
echo "Your proyect is already done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment