2011-11-22 14:29:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-11-25 15:51:02 +00:00
|
|
|
# create a temporary directory if it doesn't already exist
|
|
|
|
mkdir -p tmp
|
|
|
|
|
2011-11-22 14:29:29 +00:00
|
|
|
# cook the recipe with the old cook.rb (assuming you have set it up as described in github.com/TiddlyWiki/cooker)
|
2011-11-25 15:51:02 +00:00
|
|
|
cook $PWD/test/data/tiddlywiki.com/index.html.recipe -d $PWD -o tmp/oldcooked.html || exit 1
|
2011-11-22 14:29:29 +00:00
|
|
|
|
|
|
|
# cook it with cook.js
|
2011-11-25 15:51:02 +00:00
|
|
|
node cook.js $PWD/test/data/tiddlywiki.com/index.html.recipe > tmp/newcooked.html || exit 1
|
2011-11-22 14:29:29 +00:00
|
|
|
|
|
|
|
# compare the two
|
2011-11-26 12:51:56 +00:00
|
|
|
#opendiff tmp/oldcooked.html tmp/newcooked.html
|
2011-11-25 19:20:35 +00:00
|
|
|
|
2011-11-26 12:51:56 +00:00
|
|
|
# split the newly cooked tiddlywiki into tiddlers, first with the new ginsu
|
|
|
|
mkdir -p tmp/newtiddlers
|
|
|
|
rm -f tmp/newtiddlers/*
|
2011-11-26 13:23:26 +00:00
|
|
|
node ginsu.js tmp/newcooked.html tmp/newtiddlers || exit 1
|
2011-11-26 12:51:56 +00:00
|
|
|
|
2011-11-26 13:23:26 +00:00
|
|
|
# and now ginsu them with the old ginsu.rb
|
2011-11-26 12:51:56 +00:00
|
|
|
rm -r tmp/oldtiddlers
|
2011-11-26 13:23:26 +00:00
|
|
|
ginsu tmp/oldcooked || exit 1
|
2011-11-26 12:51:56 +00:00
|
|
|
mv oldcooked.html.0 tmp/oldtiddlers/
|
2011-11-26 13:23:26 +00:00
|
|
|
|
|
|
|
# now cook those tiddlers back again with the respective versions of cook
|
|
|
|
#cook $PWD/test/data/recipes/oldtiddlers.recipe -d $PWD -o tmp/oldrecooked.html || exit 1
|
|
|
|
node cook.js $PWD/test/data/recipes/newtiddlers.recipe > tmp/newrecooked.html || exit 1
|