hglmandel/prev

39 lines
894 B
Text
Raw Normal View History

2012-05-03 13:40:35 +00:00
#!/usr/bin/env zsh
webroot="$HOME/Sites/webroot"
2012-06-05 13:38:57 +00:00
print -- "Search script"
while [[ ! -x ./create_ymd.sh ]]; do
[[ $PWD = "/" ]] && {
print -- "Error: can't find create_ymd.sh" >&2
exit 1
}
cd ..
done
2012-05-03 13:40:35 +00:00
print -- "Create article"
./create_ymd.sh > $webroot/latest.ymd
2012-06-05 13:38:57 +00:00
print -- "Copy source codes"
2012-06-12 14:31:25 +00:00
ycp() {
2012-06-13 16:01:23 +00:00
local precedent=""
for e in $*;do
[[ $precedent != "" ]] && print -- "\t$precedent"
precedent=$e
done
2012-06-12 14:31:25 +00:00
cp $*
}
2012-06-05 13:38:57 +00:00
latestArticleDir=$(ls -l $webroot/latest.ymd | perl -pi -e 's#.*/##; s#.md$##')
2012-05-03 13:40:35 +00:00
for langue in en fr; do
2012-06-05 13:38:57 +00:00
dst="$webroot/output/Scratch/$langue/blog/$latestArticleDir/code"
2012-05-03 13:40:35 +00:00
[[ ! -d $dst ]] && mkdir -p $dst
2012-06-12 14:31:25 +00:00
ycp *.lhs(N) $dst
for dir in ??_*(N/); do
2012-06-13 16:01:23 +00:00
[[ ! -d $dst/$dir ]] && mkdir $dst/$dir
ycp $dir/*.{lhs,hs}(.N) $dst/$dir
2012-06-12 14:31:25 +00:00
done
2012-05-03 13:40:35 +00:00
done
2012-06-13 16:01:23 +00:00
print -- "\nRecompile"
2012-05-03 13:40:35 +00:00
cd $webroot
./tasks/recompile