Skip to content

Instantly share code, notes, and snippets.

@ethanmuller
Created February 18, 2014 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanmuller/54662dfe4ff1d06c16ff to your computer and use it in GitHub Desktop.
Save ethanmuller/54662dfe4ff1d06c16ff to your computer and use it in GitHub Desktop.
#!/bin/sh
# 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)
file="./site/status.log"
if [ -f "$file" ]
then
echo "Already set up!"
cd site
osascript -e 'set volume 7'
say -v 'Agnes' -r 50 'Already installed. Starting server!'
else
echo "Looks like you haven't set up yet. Let's do that."
curl -L https://github.com/daytoncleancoders/projects/raw/master/commandline/command-line-kata.zip -o command-line-kata.zip
# Step 2: Extract the zip
# (hint: tar)
# (hint: 7zip)
tar -xvf command-line-kata.zip
# Step 3: Organize the flat html app
# (hint: mkdir, ls, mv)
cd site
mkdir css js img fonts
mv *.js js
mv *.css css
mv *.png *.jpg img
mv *.woff fonts
echo "all done" > status.log
osascript -e 'set volume 7'
say -v 'Agnes' -r 50 'Done installing. Start your engines!'
fi
# Step 4: Host this site folder using a command line webserver
# (mac/nix hint: python SimpleHTTPServer)
# (windows hint: IISExpress http://bit.ly/iisexpress-dcc)
python -m SimpleHTTPServer
# 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