34 lines
730 B
Bash
Executable file
34 lines
730 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
|
|
webroot="$HOME/Sites/webroot"
|
|
|
|
print -- "Search script"
|
|
while [[ ! -x ./create_ymd.sh ]]; do
|
|
[[ $PWD = "/" ]] && {
|
|
print -- "Error: can't find create_ymd.sh" >&2
|
|
exit 1
|
|
}
|
|
cd ..
|
|
done
|
|
|
|
print -- "Create article"
|
|
./create_ymd.sh > $webroot/latest.ymd
|
|
|
|
print -- "Copy source codes"
|
|
ycp() {
|
|
print -- $*
|
|
cp $*
|
|
}
|
|
latestArticleDir=$(ls -l $webroot/latest.ymd | perl -pi -e 's#.*/##; s#.md$##')
|
|
for langue in en fr; do
|
|
dst="$webroot/output/Scratch/$langue/blog/$latestArticleDir/code"
|
|
[[ ! -d $dst ]] && mkdir -p $dst
|
|
ycp *.lhs(N) $dst
|
|
for dir in ??_*(N/); do
|
|
mkdir $dst/$dir
|
|
ycp $dir/*.{lhs,hs} $dst/$dir
|
|
done
|
|
done
|
|
|
|
cd $webroot
|
|
./tasks/recompile
|