3 # This script makes a bunch of symbolic links from the current directory
4 # to the one containing the LyX documentation.
7 echo Usage: $0 dir_where_the_docs_are_found
17 if [ ! -d ${DIR} ]; then
23 N_LYXFILES=`echo "${FILES}" | grep ".lyx" | wc -l`
25 if [ ${N_LYXFILES} -eq 0 ]; then
26 echo ${DIR} contains NO lyx files!
30 EXAMPLE_FILE=`echo "${FILES}" | grep ".lyx" | sed -e '2,$d'`
31 PARSABLEDIR=`echo ${DIR} | sed 's/\//\\\\\//g'`
32 EXAMPLE_FILE=`echo ${EXAMPLE_FILE} | sed "s/${PARSABLEDIR}\///"`
34 echo ${DIR} contains ${N_LYXFILES} .lyx files, an example being ${EXAMPLE_FILE}
36 echo "Would you like to generate links to the files in this dir? (Y/N) >N<"
39 if [ "${ANSWER}" != "y" -a "${ANSWER}" != "Y" ]; then
44 echo "Would you like these file names in the .cvsignore file? (Y/N) >N<"
48 if [ "${ANSWER}" = "y" -o "${ANSWER}" = "Y" ]; then
52 # Keep the original .cvsignore file safe
53 if [ ${CVSIGNORE} -eq 1 ]; then
54 if [ -r .cvsignore ]; then
55 if [ -r .cvsignore-safe ]; then
56 cp .cvsignore-safe .cvsignore
58 cp .cvsignore .cvsignore-safe
61 echo .cvsignore-safe > .cvsignore
62 echo '*.lyx' >> .cvsignore
63 echo '*.eps' >> .cvsignore
68 DESTFILE=`echo ${FILE} | sed "s/${PARSABLEDIR}\///"`
69 ln -fs ${FILE} ${DESTFILE}