Skip to content

Instantly share code, notes, and snippets.

@therabidbanana
Created June 22, 2011 14:43
Show Gist options
  • Save therabidbanana/1040239 to your computer and use it in GitHub Desktop.
Save therabidbanana/1040239 to your computer and use it in GitHub Desktop.
Shell script testing Nanoc compile directly after git pull
#!/bin/bash
cd /tmp
# Set up site 1.
nanoc create_site foo
cd foo
git init
git add .
git commit -m "Init"
cd ..
# Clone site 2.
git clone foo bar
cd bar
nanoc compile
cd ..
# Make change in 1.
cd foo
echo "foo change" > content/index.html
git add content/index.html
git commit -m "Change foo"
cd ..
# Pull change
cd bar
git pull
nanoc compile
create config.yaml
create Rakefile
create Rules
create content/index.html
create content/stylesheet.css
create layouts/default.html
Created a blank nanoc site at 'foo'. Enjoy!
Initialized empty Git repository in /private/tmp/foo/.git/
[master (root-commit) a24a9e0] Init
7 files changed, 216 insertions(+), 0 deletions(-)
create mode 100644 Rakefile
create mode 100644 Rules
create mode 100644 config.yaml
create mode 100644 content/index.html
create mode 100644 content/stylesheet.css
create mode 100644 layouts/default.html
create mode 100644 lib/default.rb
Cloning into bar...
done.
Loading site data...
Compiling site...
create [0.00s] output/style.css
create [0.01s] output/index.html
Site compiled in 0.10s.
[master 932d09e] Change foo
1 files changed, 1 insertions(+), 14 deletions(-)
rewrite content/index.html (100%)
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From /tmp/foo
a24a9e0..932d09e master -> origin/master
Updating a24a9e0..932d09e
Fast-forward
content/index.html | 15 +--------------
1 files changed, 1 insertions(+), 14 deletions(-)
Loading site data...
Compiling site...
skip [0.00s] output/style.css
skip [0.00s] output/index.html
create config.yaml
create Rakefile
create Rules
create content/index.html
create content/stylesheet.css
create layouts/default.html
Created a blank nanoc site at 'foo'. Enjoy!
Initialized empty Git repository in /private/tmp/foo/.git/
[master (root-commit) f7d0e82] Init
7 files changed, 216 insertions(+), 0 deletions(-)
create mode 100644 Rakefile
create mode 100644 Rules
create mode 100644 config.yaml
create mode 100644 content/index.html
create mode 100644 content/stylesheet.css
create mode 100644 layouts/default.html
create mode 100644 lib/default.rb
Cloning into bar...
done.
Loading site data...
Compiling site...
create [0.00s] output/style.css
create [0.01s] output/index.html
Site compiled in 0.06s.
[master 6c704ce] Change foo
1 files changed, 1 insertions(+), 14 deletions(-)
rewrite content/index.html (100%)
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From /tmp/foo
f7d0e82..6c704ce master -> origin/master
Updating f7d0e82..6c704ce
Fast-forward
content/index.html | 15 +--------------
1 files changed, 1 insertions(+), 14 deletions(-)
Loading site data...
Compiling site...
update [0.00s] output/index.html
skip [0.00s] output/style.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment