Skip to content

Instantly share code, notes, and snippets.

@cromwellryan
Created February 18, 2014 17:15
Show Gist options
  • Save cromwellryan/9075306 to your computer and use it in GitHub Desktop.
Save cromwellryan/9075306 to your computer and use it in GitHub Desktop.
# Step 1: Download this zip: https://github.com/daytoncleancoders/projects/raw/master/commandline/command-line-kata.zip
# (mac/nix hint: curl, wget)
# (windows hint: net.webclient)
if [ ! -d "site" ]
then
curl -O https://raw.github.com/daytoncleancoders/projects/master/commandline/command-line-kata.zip
# Step 2: Extract the zip
# (hint: tar)
# (hint: 7zip)
tar -xf command-line-kata.zip
cd site
# Step 3: Organize the flat html app
# (hint: mkdir, ls, mv)
mkdir fonts
find . -name \*.woff -print -exec mv {} fonts/ \;
mkdir css
find . -name \*.css -print -exec mv {} css/ \;
mkdir js
find . -name \*.js -print -exec mv {} js/ \;
mkdir img
find . -name \*.jpg -print -exec mv {} img/ \;
find . -name \*.png -print -exec mv {} img/ \;
# Step 4: Host this site folder using a command line webserver
# (mac/nix hint: python SimpleHTTPServer)
# (windows hint: IISExpress http://bit.ly/iisexpress-dcc)
echo python -m SimpleHTTPServer > start.sh
chmod u+x start.sh
cd ..
fi
cd site && ./start.sh
# Step 5: Turn todo.txt into an executable script
# (mac/nix hint: chmod, shebang)
# (windows hint: ps1)
# Extra: Make the script only run Step 4: Host when run subsequent times
# Extra: Convert Step 4 to putting a start script in the site folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment