Code Search for Developers
 
 
  

clean.sh from SME Web Application Framework at Krugle


Show clean.sh syntax highlighted

#!/bin/bash
### remove a book or all the books

# go to this dir
cd $(dirname $0)

if [ "$1" = "" ]
then
  echo "Usage: $0 [book_id | all] [lng]"
  exit 1;
fi

book_id=$1
lng=$2

if [ "$1" = "all" ]
then
  book_id=''
  bookid_lng=''
else
  bookid_lng=$book_id/$lng
fi

dir_list="books/xml
          books/media
          books/cache
          books/svn
          workspace/xml
          workspace/media
          workspace/cache
          downloads/tar_gz
          downloads/formats"
for dir in $dir_list
do
  rm -rf $dir/$bookid_lng
done

### remove the book from books/book_list
if [ "$1" = "all" ]
then sedexp="/./d"
else sedexp="/^$book_id:$lng/d"
fi
if [ -f books/book_list ]
then
  sed -i $sedexp books/book_list
  ../chown_norec.sh books/book_list
fi

### clean explode/tmp/, implode/tmp/
rm -rf explode/tmp/$book_id implode/tmp/$book_id

### if clean all, then clean some additional things
if [ "$1" = "all" ]
then
  # clean docs from SVN
  rm -rf SVN/{my_docs,repository,svn_dir.txt,post-commit}
  rm -rf downloads/xml_source/

  # clean books/, workspace/
  rm -rf books/ workspace/

  # clean search indexes
  rm -f ../search/*.index*
fi





See more files for this project here

SME Web Application Framework

smewebapp intends to simplify the construction of web applications for informatization of the work of SME-s (small and medium enterprises), institutions, organizations etc.

Project homepage: http://sourceforge.net/projects/smewebapp
Programming language(s): JavaScript,PHP,Shell Script,XML
License: other

  SVN/
    README
    book_list.sh
    commit-email.pl
    commit.sh
    commit_all.sh
    get_url.sh
    init.sh
    post-commit.tmpl
    sync.sh
    sync_all.sh
    txt_diff.sh
    update.sh
    update_all.sh
  books_media/
  cache/
    cache.sh
    html2xhtml.php
  downloads/
    test/
      kurani_1.tex
      kurani_1.xml
      test.sh
    checkout_xml_sources.sh
    make-all-downloads.sh
    make-downloads.sh
    sgml_dsssl.sh
    xml2latex.xsl
    xml_xsl.sh
  explode/
    explode.sh
    post_process.php
    pre_process.php
  implode/
    implode.sh
    post_process.php
    pre_process.php
    section2sect.sh
  initial_xml/
    GNU-FDL.xml
    article_template_en.xml
    book_template_en.xml
    docbookwiki_guide_en.xml
    menushpk_manual_en.xml
    menushpk_manual_sq_AL.xml
    smewebapp_manual_en.xml
    transform.xsl
    transform_template.xsl
  test/
    get_id.sh
    get_lang.sh
    sect2section.sh
    section2sect.sh
  book_list.sh
  clean.sh
  import.sh
  make-content.sh
  svn_relocate.sh