-
-
Save ethanmuller/54662dfe4ff1d06c16ff to your computer and use it in GitHub Desktop.
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/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