about summary refs log tree commit diff stats
path: root/snapshot_lesson
blob: 2a943c37775c8fe391370820f1e24c60e14b9d1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# Hacky little helper called from edit/ and sandbox/ apps to save a snapshot
# of lesson/ using git.

test -d lesson/.git || exit 0  # give up if it's not a git repo

cd lesson
# explicitly say '--all' for git 1.9
git add --all .
# bug in git: git diff -q messes up --exit-code
git diff HEAD --exit-code >/dev/null || git commit -a -m . >/dev/null
class="nx">Copyright) fmt.Printf("Date: %s\n\n", res.Date) fmt.Printf("Media Type: %s\n", res.MediaType) if res.MediaType == "image" { fmt.Printf("URL: %s\n\n", res.HDURL) } else { fmt.Printf("URL: %s\n\n", res.URL) } fmt.Printf("Explanation: %s\n", res.Explanation) }